VictoriaMetrics/vendor/google.golang.org/grpc/internal/envconfig/xds.go

57 lines
2.1 KiB
Go
Raw Normal View History

2021-09-27 16:57:40 +02:00
/*
*
* Copyright 2020 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
2021-12-20 11:06:52 +01:00
package envconfig
2021-09-27 16:57:40 +02:00
import (
"os"
)
const (
2021-12-20 11:06:52 +01:00
// XDSBootstrapFileNameEnv is the env variable to set bootstrap file name.
2021-09-27 16:57:40 +02:00
// Do not use this and read from env directly. Its value is read and kept in
2022-03-16 12:55:03 +01:00
// variable XDSBootstrapFileName.
2021-09-27 16:57:40 +02:00
//
// When both bootstrap FileName and FileContent are set, FileName is used.
2021-12-20 11:06:52 +01:00
XDSBootstrapFileNameEnv = "GRPC_XDS_BOOTSTRAP"
2022-03-16 12:55:03 +01:00
// XDSBootstrapFileContentEnv is the env variable to set bootstrap file
2021-09-27 16:57:40 +02:00
// content. Do not use this and read from env directly. Its value is read
2022-03-16 12:55:03 +01:00
// and kept in variable XDSBootstrapFileContent.
2021-09-27 16:57:40 +02:00
//
// When both bootstrap FileName and FileContent are set, FileName is used.
2021-12-20 11:06:52 +01:00
XDSBootstrapFileContentEnv = "GRPC_XDS_BOOTSTRAP_CONFIG"
2021-09-27 16:57:40 +02:00
)
var (
2021-12-20 11:06:52 +01:00
// XDSBootstrapFileName holds the name of the file which contains xDS
// bootstrap configuration. Users can specify the location of the bootstrap
// file by setting the environment variable "GRPC_XDS_BOOTSTRAP".
2021-09-27 16:57:40 +02:00
//
// When both bootstrap FileName and FileContent are set, FileName is used.
2021-12-20 11:06:52 +01:00
XDSBootstrapFileName = os.Getenv(XDSBootstrapFileNameEnv)
// XDSBootstrapFileContent holds the content of the xDS bootstrap
// configuration. Users can specify the bootstrap config by setting the
// environment variable "GRPC_XDS_BOOTSTRAP_CONFIG".
2021-09-27 16:57:40 +02:00
//
// When both bootstrap FileName and FileContent are set, FileName is used.
2021-12-20 11:06:52 +01:00
XDSBootstrapFileContent = os.Getenv(XDSBootstrapFileContentEnv)
2022-01-27 12:16:16 +01:00
2021-09-27 16:57:40 +02:00
// C2PResolverTestOnlyTrafficDirectorURI is the TD URI for testing.
2023-02-08 17:55:14 +01:00
C2PResolverTestOnlyTrafficDirectorURI = os.Getenv("GRPC_TEST_ONLY_GOOGLE_C2P_RESOLVER_TRAFFIC_DIRECTOR_URI")
2021-09-27 16:57:40 +02:00
)