Documentation
¶
Overview ¶
Package config defines the standard configuration schema supported by all versions of Relay.
Index ¶
- Constants
- func FilterGcfgError(err error) error
- func LoadConfigFile(c *Config, path string, logger *slog.Logger) error
- func LoadConfigFromEnvironment(c *Config, logger *slog.Logger) error
- func LoadConfigFromEnvironmentBase(c *Config) ct.ValidationResult
- func ValidateConfig(c *Config, logger *slog.Logger) error
- type AutoConfigConfig
- type AutoConfigKey
- type ConcurrencyConfig
- type Config
- type ConsulConfig
- type DynamoDBConfig
- type EnvConfig
- type EnvironmentID
- type EventsConfig
- type HTTPConfig
- type MainConfig
- type MobileKey
- type OfflineModeConfig
- type OpenTelemetryConfig
- type OptLogLevel
- type OptTLSVersion
- type ProxyConfig
- type RedisConfig
- type SDKKey
Constants ¶
const ( // DefaultPort is the port that Relay runs on if not otherwise specified. DefaultPort = 8030 // DefaultBaseURI is the default value for Config.BaseURI. This is the base URI of LaunchDarkly // services for server-side SDKs other than streaming, such as polling and Big Segment services. DefaultBaseURI = "https://sdk.launchdarkly.com" // DefaultClientSideBaseURI is the default value for Config.ClientSideBaseURI. This is the base // URI of LaunchDarkly services for client-side SDKs other than streaming, such as polling and goals. DefaultClientSideBaseURI = "https://clientsdk.launchdarkly.com" // DefaultStreamURI is the default value for Config.StreamURI. This is the base URI of the // LaunchDarkly streaming service for server-side SDKs. The Relay Proxy does not need an equivalent // for client-side SDKs, because in its own connections to LaunchDarkly it always pretends to be a // server-side SDK. DefaultStreamURI = "https://stream.launchdarkly.com" // DefaultEventsURI is the default value for Config.EventsURI. This is the base URI of the // LaunchDarkly service for recording events. DefaultEventsURI = "https://events.launchdarkly.com" // DefaultInitTimeout is the default value for MainConfig.InitTimeout if not specified. DefaultInitTimeout = time.Second * 10 // DefaultGracefulShutdownTimeout is the default value for MainConfig.GracefulShutdownTimeout if not specified. DefaultGracefulShutdownTimeout = time.Second * 30 // DefaultEventCapacity is the default value for EventsConfig.Capacity if not specified. DefaultEventCapacity = 1000 // DefaultMetricsCapacity is the default value for EventsConfig.MetricsCapacity if not specified. // This is the maximum queue capacity for the usage-metrics event publisher, which emits one event // per concurrent unique connection on each flush. It is set well above DefaultEventCapacity because // high-concurrency nodes routinely exceed 1000 unique connections. DefaultMetricsCapacity = 10000 // DefaultMetricsInitialCapacity is the number of events the usage-metrics publisher queue // preallocates space for. The queue grows on demand from this size up to MetricsCapacity, so that // the higher maximum does not reserve all of its memory up front on nodes that never reach it. DefaultMetricsInitialCapacity = 1000 // DefaultHeartbeatInterval is the default value for MainConfig.HeartBeatInterval if not specified. DefaultHeartbeatInterval = time.Minute * 3 // DefaultEventsFlushInterval is the default value for EventsConfig.FlushInterval if not specified. DefaultEventsFlushInterval = time.Second * 5 // DefaultDisconnectedStatusTime is the default value for MainConfig.DisconnectedStatusTime if not specified. DefaultDisconnectedStatusTime = time.Minute // DefaultDatabaseCacheTTL is the default value for the LocalTTL parameter for databases if not specified. DefaultDatabaseCacheTTL = time.Second * 30 // DefaultBigSegmentsStaleThreshold is the default value for MainConfig.BigSegmentsStaleThreshold if not specified. DefaultBigSegmentsStaleThreshold = time.Minute * 5 // DefaultMaxClientRequestBodySize is the default value for MainConfig.MaxClientRequestBodySize if not specified. // It bounds how much of a REPORT evaluation request body the Relay Proxy will read into memory, protecting the // process from memory exhaustion caused by oversized request bodies. DefaultMaxClientRequestBodySize = 5 * units.MiB // AutoConfigEnvironmentIDPlaceholder is a string that can appear within // AutoConfigConfig.EnvDataStorePrefix or AutoConfigConfig.EnvDataStoreTableName to indicate that // the environment ID should be substituted at that point. // // For instance, if EnvDataStorePrefix is "LD-$CID", the value of that setting for an environment // whose ID is "12345" would be "LD-12345". // // The same convention is used in OfflineModeConfig. AutoConfigEnvironmentIDPlaceholder = "$CID" )
const ( SignalExporterOTLP = "otlp" SignalExporterNone = "none" )
The per-signal exporter values Relay acts on: the specification's default and its opt-out. The specification defines several more, along with a comma-separated list syntax; Relay warns about anything else and treats it as unset.
const ( OTLPProtocolGRPC = "grpc" OTLPProtocolHTTPProtobuf = "http/protobuf" )
The OTEL_EXPORTER_OTLP_PROTOCOL values Relay accepts, with their specification names. The Go SDK has no "http/json" exporter, so Relay warns about that value and sends protobuf over HTTP. An OTLP/HTTP receiver must accept both encodings, so the configured endpoint still works.
Variables ¶
This section is empty.
Functions ¶
func FilterGcfgError ¶
FilterGcfgError transforms errors returned by gcfg to our preferred format.
func LoadConfigFile ¶
LoadConfigFile reads a configuration file into a Config struct and performs basic validation.
The Config parameter should be initialized with default values first.
func LoadConfigFromEnvironment ¶
LoadConfigFromEnvironment sets parameters in a Config struct from environment variables.
The Config parameter should be initialized with default values first.
func LoadConfigFromEnvironmentBase ¶
func LoadConfigFromEnvironmentBase(c *Config) ct.ValidationResult
LoadConfigFromEnvironmentBase performs the initial steps of reading Config fields from environment variables, but returns the intermediate result before fully validating it.
func ValidateConfig ¶
ValidateConfig ensures that the configuration does not contain contradictory properties.
This method covers validation rules that can't be enforced on a per-field basis (for instance, if either field A or field B can be specified but it's invalid to specify both). It is allowed to modify the Config struct in order to canonicalize settings in a way that simplifies things for the Relay code (for instance, converting Redis host/port settings into a Redis URL, or converting deprecated fields to non-deprecated ones).
LoadConfigFromEnvironment and LoadConfigFromFile both call this method as a last step, but it is also called again by the Relay constructor because it is possible for application code that uses Relay as a library to construct a Config programmatically.
Types ¶
type AutoConfigConfig ¶
type AutoConfigConfig struct {
Key AutoConfigKey `conf:"AUTO_CONFIG_KEY"`
EnvDatastorePrefix string `conf:"ENV_DATASTORE_PREFIX"`
EnvDatastoreTableName string `conf:"ENV_DATASTORE_TABLE_NAME"`
EnvAllowedOrigin ct.OptStringList `conf:"ENV_ALLOWED_ORIGIN"`
EnvAllowedHeader ct.OptStringList `conf:"ENV_ALLOWED_HEADER"`
CacheKey string `conf:"AUTO_CONFIG_CACHE_KEY"`
CacheEncryptionKey string `conf:"AUTO_CONFIG_CACHE_ENCRYPTION_KEY"`
}
AutoConfigConfig contains configuration parameters for the auto-configuration feature.
type AutoConfigKey ¶
type AutoConfigKey string
AutoConfigKey is a type tag to indicate when a string is used as an auto-configuration key.
func (AutoConfigKey) Defined ¶
func (k AutoConfigKey) Defined() bool
func (AutoConfigKey) GetAuthorizationHeaderValue ¶
func (k AutoConfigKey) GetAuthorizationHeaderValue() string
GetAuthorizationHeaderValue for AutoConfigKey returns the same string, since these keys are passed in the Authorization header. Note that unlike the other kinds of authorization keys, this one is never present in an incoming request; it is only used in requests from Relay to LaunchDarkly.
func (AutoConfigKey) Masked ¶
func (k AutoConfigKey) Masked() string
func (AutoConfigKey) String ¶
func (k AutoConfigKey) String() string
func (*AutoConfigKey) UnmarshalText ¶
func (k *AutoConfigKey) UnmarshalText(data []byte) error
UnmarshalText allows the AutoConfigKey type to be set from environment variables.
type ConcurrencyConfig ¶
type ConcurrencyConfig struct {
// MaxConcurrent is the maximum number of initialization deliveries allowed in flight
// at once. A value of 0 or less disables the limit.
MaxConcurrent ct.OptInt `conf:"INIT_MAX_CONCURRENT"`
// MaxQueued is the maximum number of clients that may wait for a slot once
// MaxConcurrent is reached. A value of 0 adds no waiting capacity: an excess client
// is rejected rather than queued, though one arriving just as a slot is released may
// briefly wait to take it.
MaxQueued ct.OptInt `conf:"INIT_MAX_QUEUED"`
// SendTimeout is the longest a single initialization delivery may hold a concurrency
// slot before its connection is closed to reclaim the slot (the SDK then reconnects).
//
// Enforcement is not in this package: the delivery path that consumes this option --
// applying its default and a per-write throughput floor that cuts a stalled client
// well before this cap -- lands with the code that wires the limiter into the
// endpoints. Until then the option is read by nothing.
SendTimeout ct.OptDuration `conf:"INIT_SEND_TIMEOUT"`
}
ConcurrencyConfig corresponds to the [Concurrency] section in the configuration file.
It configures a limit on how many SDK initialization deliveries the Relay Proxy may perform at the same time, covering both polling and streaming, to cap the memory and egress that a burst of connecting SDKs can consume. The limit is disabled unless MaxConcurrent is set. The code that wires the limiter into the endpoints consumes this section; until that lands, setting it changes nothing.
type Config ¶
type Config struct {
Main MainConfig
AutoConfig AutoConfigConfig
OfflineMode OfflineModeConfig
Events EventsConfig
Redis RedisConfig
Consul ConsulConfig
DynamoDB DynamoDBConfig
Environment map[string]*EnvConfig
Proxy ProxyConfig
HTTP HTTPConfig
Concurrency ConcurrencyConfig
OpenTelemetry OpenTelemetryConfig
}
Config describes the configuration for a relay instance.
Some fields use special types that enforce validation rules, such as URL fields which must be absolute URLs, port numbers which must be greater than zero, or durations. This validation is done automatically when reading the configuration from a file or from environment variables.
If you are incorporating Relay into your own code and configuring it programmatically, you may need to use functions from go-configtypes such as NewOptDuration to set fields that have validation rules.
Since configuration options can be set either programmatically, or from a file, or from environment variables, individual fields are not documented here; instead, see the `README.md` section on configuration.
type ConsulConfig ¶
type ConsulConfig struct {
Host string `conf:"CONSUL_HOST"`
LocalTTL ct.OptDuration `conf:"CACHE_TTL"`
Token string `conf:"CONSUL_TOKEN"`
TokenFile string `conf:"CONSUL_TOKEN_FILE"`
}
ConsulConfig configures the optional Consul integration.
Consul is enabled if Host is non-empty.
This corresponds to the [Consul] section in the configuration file.
Since configuration options can be set either programmatically, or from a file, or from environment variables, individual fields are not documented here; instead, see the `README.md` section on configuration.
type DynamoDBConfig ¶
type DynamoDBConfig struct {
Enabled bool `conf:"USE_DYNAMODB"`
TableName string `conf:"DYNAMODB_TABLE"`
URL ct.OptURLAbsolute `conf:"DYNAMODB_URL"`
LocalTTL ct.OptDuration `conf:"CACHE_TTL"`
}
DynamoDBConfig configures the optional DynamoDB integration, which is used only if Enabled is true.
This corresponds to the [DynamoDB] section in the configuration file.
Since configuration options can be set either programmatically, or from a file, or from environment variables, individual fields are not documented here; instead, see the `README.md` section on configuration.
type EnvConfig ¶
type EnvConfig struct {
SDKKey SDKKey // set from env var LD_ENV_envname
MobileKey MobileKey `conf:"LD_MOBILE_KEY_"`
EnvID EnvironmentID `conf:"LD_CLIENT_SIDE_ID_"`
Prefix string `conf:"LD_PREFIX_"` // used only if Redis, Consul, or DynamoDB is enabled
TableName string `conf:"LD_TABLE_NAME_"` // used only if DynamoDB is enabled
AllowedOrigin ct.OptStringList `conf:"LD_ALLOWED_ORIGIN_"`
AllowedHeader ct.OptStringList `conf:"LD_ALLOWED_HEADER_"`
SecureMode bool `conf:"LD_SECURE_MODE_"`
LogLevel OptLogLevel `conf:"LD_LOG_LEVEL_"`
TTL ct.OptDuration `conf:"LD_TTL_"`
Offline bool // set to true if this environment was created in offline mode
}
EnvConfig describes an environment to be relayed. There may be any number of these.
This corresponds to one of the [environment "env-name"] sections in the configuration file. In the Config.Environment map, each key is an environment name and each value is an EnvConfig.
Since configuration options can be set either programmatically, or from a file, or from environment variables, individual fields are not documented here; instead, see the `README.md` section on configuration.
type EnvironmentID ¶
type EnvironmentID string
EnvironmentID is a type tag to indicate when a string is used as a client-side environment ID for a LaunchDarkly environment.
func (EnvironmentID) Defined ¶
func (k EnvironmentID) Defined() bool
func (EnvironmentID) GetAuthorizationHeaderValue ¶
func (k EnvironmentID) GetAuthorizationHeaderValue() string
GetAuthorizationHeaderValue for EnvironmentID returns an empty string, since environment IDs are not passed in a header but as part of the request URL.
func (EnvironmentID) Masked ¶
func (k EnvironmentID) Masked() string
Masked is an alias for String(), because EnvironmentIDs are considered non-sensitive public information.
func (EnvironmentID) String ¶
func (k EnvironmentID) String() string
func (*EnvironmentID) UnmarshalText ¶
func (k *EnvironmentID) UnmarshalText(data []byte) error
UnmarshalText allows the EnvironmentID type to be set from environment variables.
type EventsConfig ¶
type EventsConfig struct {
EventsURI ct.OptURLAbsolute `conf:"EVENTS_HOST"`
SendEvents bool `conf:"USE_EVENTS"`
FlushInterval ct.OptDuration `conf:"EVENTS_FLUSH_INTERVAL"`
Capacity ct.OptIntGreaterThanZero `conf:"EVENTS_CAPACITY"`
MetricsCapacity ct.OptIntGreaterThanZero `conf:"EVENTS_METRICS_CAPACITY"`
MaxInboundPayloadSize ct.OptBase2Bytes `conf:"EVENTS_MAX_INBOUND_PAYLOAD_SIZE"`
}
EventsConfig contains configuration parameters for proxying events.
Since configuration options can be set either programmatically, or from a file, or from environment variables, individual fields are not documented here; instead, see the `README.md` section on configuration.
type HTTPConfig ¶
type HTTPConfig struct {
EnableCompression bool `conf:"HTTP_ENABLE_COMPRESSION"`
IdleConnTimeout ct.OptDuration `conf:"HTTP_IDLE_CONN_TIMEOUT"`
MaxIdleConns ct.OptInt `conf:"HTTP_MAX_IDLE_CONNS"`
MaxIdleConnsPerHost int `conf:"HTTP_MAX_IDLE_CONNS_PER_HOST"`
DisableKeepAlives bool `conf:"HTTP_DISABLE_KEEPALIVE"`
}
HTTPConfig contains HTTP-related configuration options.
This corresponds to the [Http] section in the configuration file.
Since configuration options can be set either programmatically, or from a file, or from environment variables, individual fields are not documented here; instead, see the `README.md` section on configuration.
type MainConfig ¶
type MainConfig struct {
ExitAlways bool `conf:"EXIT_ALWAYS"`
StreamURI ct.OptURLAbsolute `conf:"STREAM_URI"`
BaseURI ct.OptURLAbsolute `conf:"BASE_URI"`
ClientSideBaseURI ct.OptURLAbsolute `conf:"CLIENT_SIDE_BASE_URI"`
Port ct.OptIntGreaterThanZero `conf:"PORT"`
InitTimeout ct.OptDuration `conf:"INIT_TIMEOUT"`
GracefulShutdownTimeout ct.OptDuration `conf:"GRACEFUL_SHUTDOWN_TIMEOUT"`
HeartbeatInterval ct.OptDuration `conf:"HEARTBEAT_INTERVAL"`
MaxClientConnectionTime ct.OptDuration `conf:"MAX_CLIENT_CONNECTION_TIME"`
MaxClientRequestBodySize ct.OptBase2Bytes `conf:"MAX_CLIENT_REQUEST_BODY_SIZE"`
PingStreamJitterTime ct.OptDuration `conf:"PING_STREAM_JITTER_TIME"`
DisconnectedStatusTime ct.OptDuration `conf:"DISCONNECTED_STATUS_TIME"`
TLSEnabled bool `conf:"TLS_ENABLED"`
TLSCert string `conf:"TLS_CERT"`
TLSKey string `conf:"TLS_KEY"`
TLSMinVersion OptTLSVersion `conf:"TLS_MIN_VERSION"`
LogLevel OptLogLevel `conf:"LOG_LEVEL"`
BigSegmentsStaleAsDegraded bool `conf:"BIG_SEGMENTS_STALE_AS_DEGRADED"`
BigSegmentsStaleThreshold ct.OptDuration `conf:"BIG_SEGMENTS_STALE_THRESHOLD"`
ExpiredCredentialCleanupInterval ct.OptDuration `conf:"EXPIRED_CREDENTIAL_CLEANUP_INTERVAL"`
}
MainConfig contains global configuration options for Relay.
This corresponds to the [Main] section in the configuration file.
Since configuration options can be set either programmatically, or from a file, or from environment variables, individual fields are not documented here; instead, see the `README.md` section on configuration.
type MobileKey ¶
type MobileKey string
MobileKey is a type tag to indicate when a string is used as a mobile key for a LaunchDarkly environment.
func (MobileKey) GetAuthorizationHeaderValue ¶
GetAuthorizationHeaderValue for MobileKey returns the same string, since mobile keys are passed in the Authorization header.
func (*MobileKey) UnmarshalText ¶
UnmarshalText allows the MobileKey type to be set from environment variables.
type OfflineModeConfig ¶
type OfflineModeConfig struct {
FileDataSource string `conf:"FILE_DATA_SOURCE"`
FileDataSourceMonitoringInterval ct.OptDuration `conf:"FILE_DATA_SOURCE_MONITORING_INTERVAL"`
EnvDatastorePrefix string `conf:"ENV_DATASTORE_PREFIX"`
EnvDatastoreTableName string `conf:"ENV_DATASTORE_TABLE_NAME"`
EnvAllowedOrigin ct.OptStringList `conf:"ENV_ALLOWED_ORIGIN"`
EnvAllowedHeader ct.OptStringList `conf:"ENV_ALLOWED_HEADER"`
}
OfflineModeConfig contains configuration parameters for the offline/file data source feature.
type OpenTelemetryConfig ¶
type OpenTelemetryConfig struct {
Enabled bool `conf:"USE_OTLP"`
Protocol string `conf:"OTEL_EXPORTER_OTLP_PROTOCOL"`
MetricsCardinalityLimit ct.OptInt `conf:"OTEL_METRICS_CARDINALITY_LIMIT"`
EnvironmentStatusMetrics bool `conf:"OTEL_ENVIRONMENT_STATUS_METRICS"`
LogsExporter string `conf:"OTEL_LOGS_EXPORTER"`
TracesExporter string `conf:"OTEL_TRACES_EXPORTER"`
MetricsExporter string `conf:"OTEL_METRICS_EXPORTER"`
}
OpenTelemetryConfig configures the optional OTLP export integration, which is used only if Enabled is true.
This corresponds to the [OpenTelemetry] section in the configuration file.
Most standard OTEL environment variables (OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_HEADERS, OTEL_SERVICE_NAME, etc.) are read directly by the OpenTelemetry SDK and should not be duplicated here. Only Relay-specific settings belong in this struct.
MetricsCardinalityLimit is an exception to that rule: the OpenTelemetry specification defines no environment variable for the cardinality limit, and the Go SDK's own OTEL_GO_X_CARDINALITY_LIMIT sits in its experimental namespace, so Relay owns this setting. When it is undefined, Relay applies no option and the SDK's default (or OTEL_GO_X_CARDINALITY_LIMIT, if the operator set it) stands.
EnvironmentStatusMetrics is Relay's own for the same reason: it selects how much of the status document is reported, which no OpenTelemetry variable describes.
EnvironmentStatusMetrics is off by default, because its cardinality follows the number of environments Relay serves rather than the traffic it receives. In automatic configuration mode that number is every environment in the account, and the OpenTelemetry cardinality cap discards series silently once it is reached. The relay-level status metrics, whose cardinality is fixed, are reported whenever Enabled is true; this setting only adds which environment each of them counted.
LogsExporter, TracesExporter and MetricsExporter are read by Relay rather than by the SDK for a different reason: the specification defines them, but only the autoconfiguration packages that other languages ship implement them, and the Go SDK has none. They are declared here, under their specification names, so that operators arriving from another LaunchDarkly SDK reach for the variable that already works and so that the setting can also be given in the configuration file.
Relay implements only the OTLP exporter, so "otlp" and "none" are the values it acts on. Because these variables are commonly set host- or pod-wide for other workloads, any other value the specification allows -- "zipkin", "prometheus", "console" -- must not stop Relay from starting. The specification requires an unrecognized enum value to be warned about and then ignored, which leaves the signal exporting over OTLP exactly as it did before these settings existed.
func (OpenTelemetryConfig) ExportLogs ¶
func (c OpenTelemetryConfig) ExportLogs() bool
ExportLogs reports whether Relay should export logs over OTLP.
func (OpenTelemetryConfig) ExportMetrics ¶
func (c OpenTelemetryConfig) ExportMetrics() bool
ExportMetrics reports whether Relay should export metrics over OTLP.
func (OpenTelemetryConfig) ExportProtocol ¶
func (c OpenTelemetryConfig) ExportProtocol() string
ExportProtocol returns the OTLP transport for the exporters: OTLPProtocolGRPC or OTLPProtocolHTTPProtobuf. Relay uses gRPC when the protocol is unset. Validation rejects any value that this function does not map.
func (OpenTelemetryConfig) ExportTraces ¶
func (c OpenTelemetryConfig) ExportTraces() bool
ExportTraces reports whether Relay should export traces over OTLP.
type OptLogLevel ¶
type OptLogLevel struct {
// contains filtered or unexported fields
}
OptLogLevel represents an optional log level parameter. It must match one of the level names "debug", "info", "warn", "error", or "none" (case-insensitive).
The zero value OptLogLevel{} is valid and undefined (IsDefined() is false).
func NewOptLogLevel ¶
func NewOptLogLevel(level slog.Level) OptLogLevel
NewOptLogLevel creates an OptLogLevel that wraps the given value.
func NewOptLogLevelFromString ¶
func NewOptLogLevelFromString(levelName string) (OptLogLevel, error)
NewOptLogLevelFromString creates an OptLogLevel from a string that must either be a valid log level name or an empty string.
func (OptLogLevel) GetOrElse ¶
func (o OptLogLevel) GetOrElse(orElseValue slog.Level) slog.Level
GetOrElse returns the wrapped value, or the alternative value if there is no value.
func (OptLogLevel) IsDefined ¶
func (o OptLogLevel) IsDefined() bool
IsDefined returns true if the instance contains a value.
func (*OptLogLevel) UnmarshalText ¶
func (o *OptLogLevel) UnmarshalText(data []byte) error
UnmarshalText attempts to parse the value from a byte string, using the same logic as NewOptLogLevelFromString.
type OptTLSVersion ¶
type OptTLSVersion struct {
// contains filtered or unexported fields
}
OptTLSVersion represents an optional TLS level parameter. When represented as a string, it must be "1.0", "1.1", "1.2", or "1.3". This is converted into a uint16 value as defined by crypto/tls.
func NewOptTLSVersion ¶
func NewOptTLSVersion(value uint16) OptTLSVersion
NewOptTLSVersion creates an OptTLSVersion that wraps the given value. It does not validate that the value is one supported by crypto/tls. A value of zero is equivalent to undefined.
func NewOptTLSVersionFromString ¶
func NewOptTLSVersionFromString(version string) (OptTLSVersion, error)
NewOptTLSVersionFromString creates an OptTLSVersion corresponding to the given version string, which must be either a valid TLS major and minor version ("1.2") or an empty string.
func (OptTLSVersion) Get ¶
func (o OptTLSVersion) Get() uint16
Get returns the wrapped value, or zero if there is no value.
func (OptTLSVersion) IsDefined ¶
func (o OptTLSVersion) IsDefined() bool
IsDefined returns true if the instance contains a value.
func (OptTLSVersion) String ¶
func (o OptTLSVersion) String() string
String returns a string description of the value.
func (*OptTLSVersion) UnmarshalText ¶
func (o *OptTLSVersion) UnmarshalText(data []byte) error
UnmarshalText attempts to parse the value from a byte string, using the same logic as NewOptTLSVersionFromString.
type ProxyConfig ¶
type ProxyConfig struct {
URL ct.OptURLAbsolute `conf:"PROXY_URL"`
NTLMAuth bool `conf:"PROXY_AUTH_NTLM"`
User string `conf:"PROXY_AUTH_USER"`
Password string `conf:"PROXY_AUTH_PASSWORD"`
Domain string `conf:"PROXY_AUTH_DOMAIN"`
CACertFiles ct.OptStringList `conf:"PROXY_CA_CERTS"`
}
ProxyConfig represents all the supported proxy options.
Since configuration options can be set either programmatically, or from a file, or from environment variables, individual fields are not documented here; instead, see the `README.md` section on configuration.
type RedisConfig ¶
type RedisConfig struct {
Host string `conf:"REDIS_HOST"`
Port ct.OptIntGreaterThanZero
URL ct.OptURLAbsolute `conf:"REDIS_URL"`
LocalTTL ct.OptDuration `conf:"CACHE_TTL"`
TLS bool `conf:"REDIS_TLS"`
Username string `conf:"REDIS_USERNAME"`
Password string `conf:"REDIS_PASSWORD"`
ClientCertificateFile string `conf:"REDIS_CLIENT_CERT_FILE"`
ClientKeyFile string `conf:"REDIS_CLIENT_KEY_FILE"`
CAFile string `conf:"REDIS_CA_FILE"`
AtomicUpsert bool `conf:"REDIS_ATOMIC_UPSERT"`
ConnectTimeout ct.OptDuration `conf:"REDIS_CONNECT_TIMEOUT"`
ReadTimeout ct.OptDuration `conf:"REDIS_READ_TIMEOUT"`
}
RedisConfig configures the optional Redis integration.
Redis is enabled if URL or Host is non-empty or if Port is set. If only Host or Port is set, the other value is set to defaultRedisPort or defaultRedisHost. It is an error to set Host or Port if URL is also set.
This corresponds to the [Redis] section in the configuration file.
Since configuration options can be set either programmatically, or from a file, or from environment variables, individual fields are not documented here; instead, see the `README.md` section on configuration.
func (RedisConfig) TLSEnabled ¶
func (c RedisConfig) TLSEnabled() bool
TLSEnabled is true if TLS was requested either with the TLS option or with a rediss:// URL.
type SDKKey ¶
type SDKKey string
SDKKey is a type tag to indicate when a string is used as a server-side SDK key for a LaunchDarkly environment.
func (SDKKey) GetAuthorizationHeaderValue ¶
GetAuthorizationHeaderValue for SDKKey returns the same string, since SDK keys are passed in the Authorization header.
func (*SDKKey) UnmarshalText ¶
UnmarshalText allows the SDKKey type to be set from environment variables.