Documentation
¶
Index ¶
- Constants
- Variables
- type APIKeys
- type ApiKeyType
- type CommonFlagSet
- type Config
- func (c *Config) APIKeyExists(apiKey string) bool
- func (c *Config) APIKeysAdminExists(apiKey string) bool
- func (c *Config) AddFlagSet(flagset FlagSet) error
- func (c *Config) AttachConfigChangeCallback(callback func(newConfig *Config))
- func (c *Config) EffectiveAwsApiGatewayBasePath(logger *zap.Logger) string
- func (c *Config) EffectiveMonitoringPort(logger *zap.Logger) int
- func (c *Config) ForceReloadAPIKeys()
- func (c *Config) GetAPIKeys() []string
- func (c *Config) GetAuthorizedKeys() APIKeys
- func (c *Config) GetFlagSetAPIKeys(flagsetName string) ([]string, error)
- func (c *Config) GetFlagSets() []FlagSet
- func (c *Config) IsAuthenticationEnabled() bool
- func (c *Config) IsDebugEnabled() bool
- func (c *Config) IsSwaggerEnabled() bool
- func (c *Config) IsUsingFlagsets() bool
- func (c *Config) IsValid() error
- func (c *Config) LambdaAdapter(logger *zap.Logger) LambdaAdapter
- func (c *Config) RemoveFlagSet(flagsetName string) error
- func (c *Config) ServerHost() string
- func (c *Config) ServerMode(logger *zap.Logger) ServerMode
- func (c *Config) ServerPort(logger *zap.Logger) int
- func (c *Config) SetAPIKeys(apiKeys []string)deprecated
- func (c *Config) SetAuthorizedKeys(authorizedKeys APIKeys)
- func (c *Config) SetFlagSetAPIKeys(flagsetName string, apiKeys []string) error
- func (c *Config) StopConfigChangeWatcher() error
- func (c *Config) SwaggerHost() string
- func (c *Config) UnixSocketPath() string
- func (c *Config) ZapLogLevel() zapcore.Level
- type ConfigLoader
- type ExporterConf
- type ExporterKind
- type FlagSet
- type JaegerSampler
- type JaegerSamplerConfiguration
- type JaegerSamplerManager
- type JaegerSamplerManagerHost
- type JaegerSamplerMax
- type JaegerSamplerRefresh
- type LambdaAdapter
- type NotifierConf
- type NotifierKind
- type OfrepEventStream
- type OpenTelemetryConfiguration
- type OtelExporter
- type OtelExporterOtlp
- type OtelResource
- type Server
- type ServerMode
- type Swagger
Constants ¶
const DefaultLogLevel = "info"
Variables ¶
var DefaultExporter = struct { Format string LogFormat string FileName string CsvFormat string FlushInterval time.Duration MaxEventInMemory int64 ParquetCompressionCodec string LogLevel string ExporterEventType ffclient.ExporterEventType }{ Format: "JSON", LogFormat: "[{{ .FormattedDate}}] user=\"{{ .UserKey}}\", flag=\"{{ .Key}}\", value=\"{{ .Value}}\"", FileName: "flag-variation-{{ .Hostname}}-{{ .Timestamp}}.{{ .Format}}", CsvFormat: "{{ .Kind}};{{ .ContextKind}};{{ .UserKey}};{{ .CreationDate}};{{ .Key}};{{ .Variation}};" + "{{ .Value}};{{ .Default}};{{ .Source}}\n", FlushInterval: 60000 * time.Millisecond, MaxEventInMemory: 100000, ParquetCompressionCodec: parquet.CompressionCodec_SNAPPY.String(), LogLevel: DefaultLogLevel, ExporterEventType: ffclient.FeatureEventExporter, }
Functions ¶
This section is empty.
Types ¶
type APIKeys ¶ added in v1.28.0
type APIKeys struct {
Admin []string `mapstructure:"admin" koanf:"admin"`
Evaluation []string `mapstructure:"evaluation" koanf:"evaluation"`
}
APIKeys is a struct to store the API keys for the different endpoints
type ApiKeyType ¶ added in v1.45.5
type ApiKeyType = string
const ( EvaluationKeyType ApiKeyType = "EVALUATION" AdminKeyType ApiKeyType = "ADMIN" FlagSetKeyType ApiKeyType = "FLAGSET" ErrorKeyType ApiKeyType = "ERROR" )
Enum for the type of the API keys
type CommonFlagSet ¶ added in v1.45.5
type CommonFlagSet struct {
// Retriever is the configuration on how to retrieve the file
Retriever *retrieverconf.RetrieverConf `mapstructure:"retriever" koanf:"retriever"`
// Retrievers is the exact same things than Retriever but allows to give more than 1 retriever at the time.
// We are dealing with config files in order, if you have the same flag name in multiple files it will be override
// based of the order of the retrievers in the slice.
//
// Note: If both Retriever and Retrievers are set, we will start by calling the Retriever and,
// after we will use the order of Retrievers.
Retrievers *[]retrieverconf.RetrieverConf `mapstructure:"retrievers" koanf:"retrievers"`
// Notifiers is the configuration on where to notify a flag change
Notifiers []NotifierConf `mapstructure:"notifiers" koanf:"notifiers"`
// FixNotifiers, Before version v1.46.0, the notifier was called "notifier" instead of "notifiers".
// This is a backward compatibility fix to allow to use the old configuration.
// This will be removed in a future version.
//
// Deprecated: use Notifiers instead.
FixNotifiers []NotifierConf `mapstructure:"notifier" koanf:"notifier"`
// Exporter is the configuration on how to export data
Exporter *ExporterConf `mapstructure:"exporter" koanf:"exporter"`
// Exporters is the exact same things than Exporter but allows to give more than 1 exporter at the time.
Exporters *[]ExporterConf `mapstructure:"exporters" koanf:"exporters"`
// FileFormat (optional) is the format of the file to retrieve (available YAML, TOML and JSON)
// Default: YAML
FileFormat string `mapstructure:"fileFormat" koanf:"fileformat"`
// PollingInterval (optional) Poll every X time
// The minimum possible is 1 second
// Default: 60 seconds
PollingInterval int `mapstructure:"pollingInterval" koanf:"pollinginterval"`
// StartWithRetrieverError (optional) If true, the relay proxy will start even if we did not get any flags from
// the retriever. It will serve only default values until the retriever returns the flags.
// The init method will not return any error if the flag file is unreachable.
// Default: false
StartWithRetrieverError bool `mapstructure:"startWithRetrieverError" koanf:"startwithretrievererror"`
// EnablePollingJitter (optional) set to true if you want to avoid having true periodicity when
// retrieving your flags. It is useful to avoid having spike on your flag configuration storage
// in case your application is starting multiple instance at the same time.
// We ensure a deviation that is maximum + or - 10% of your polling interval.
// Default: false
EnablePollingJitter bool `mapstructure:"enablePollingJitter" koanf:"enablepollingjitter"`
// DisableNotifierOnInit (optional) set to true if you do not want to call any notifier
// when the flags are loaded.
// This is useful if you do not want a Slack/Webhook notification saying that
// the flags have been added every time you start the application.
// Default is set to false for backward compatibility.
// Default: false
DisableNotifierOnInit bool `mapstructure:"disableNotifierOnInit" koanf:"disablenotifieroninit"`
// EvaluationContextEnrichment is the flag to enable the evaluation context enrichment.
EvaluationContextEnrichment map[string]any `mapstructure:"evaluationContextEnrichment" koanf:"evaluationcontextenrichment"` //nolint: lll
// PersistentFlagConfigurationFile is the flag to enable the persistent flag configuration file.
PersistentFlagConfigurationFile string `mapstructure:"persistentFlagConfigurationFile" koanf:"persistentflagconfigurationfile"` //nolint: lll
// Environment is the environment of the flag set.
Environment string `mapstructure:"environment" koanf:"environment"`
}
type Config ¶
type Config struct {
// CommonFlagSet is the common flag set for the relay proxy
CommonFlagSet `mapstructure:",inline" koanf:",squash"`
// Server is the server configuration, including host, port, and unix socket
Server Server `mapstructure:"server" koanf:"server"`
// Swagger is the swagger configuration
Swagger Swagger `mapstructure:"swagger" koanf:"swagger"`
// OfrepEventStream (optional) advertises the flag-change SSE endpoint in the OFREP bulk
// evaluation response so that providers can subscribe to changes instead of polling.
// It is enabled when OfrepEventStream.BaseURL is set.
OfrepEventStream OfrepEventStream `mapstructure:"ofrepEventStream" koanf:"ofrepeventstream"`
// HideBanner (optional) if true, we don't display the go-feature-flag relay proxy banner
HideBanner bool `mapstructure:"hideBanner" koanf:"hidebanner"`
// EnablePprof (optional) if true, go-feature-flag relay proxy will start
// the pprof endpoints on the same port as the monitoring.
// Default: false
EnablePprof bool `mapstructure:"enablePprof" koanf:"enablepprof"`
// LogLevel (optional) sets the verbosity for logging,
// Possible values: debug, info, warn, error, dpanic, panic, fatal
// If level debug go-feature-flag relay proxy will run on debug mode, with more logs and custom responses
// Default: debug
LogLevel string `mapstructure:"logLevel" koanf:"loglevel"`
// LogFormat (optional) sets the log message format
// Possible values: json, logfmt
// Default: json
LogFormat string `mapstructure:"logFormat" koanf:"logformat"`
// ExporterCleanQueueInterval (optional) is the duration between each cleaning of the queue by the thread in charge
// of removing the old events.
// Default: 1 minute
ExporterCleanQueueInterval time.Duration `mapstructure:"exporterCleanQueueInterval" koanf:"exportercleanqueueinterval"`
// Version is the version of the relay-proxy
Version string `mapstructure:"version" koanf:"version"`
// Disable x-gofeatureflag-version header in the relay-proxy HTTP response
// Default: false
DisableVersionHeader bool `mapstructure:"disableVersionHeader" koanf:"disableversionheader"`
// AuthorizedKeys list of API keys that authorized to use endpoints
AuthorizedKeys APIKeys `mapstructure:"authorizedKeys" koanf:"authorizedkeys"`
// EvaluationContextEnrichment (optional) will be merged with the evaluation context sent during the evaluation.
// It is useful to add common attributes to all the evaluations, such as a server version, environment, ...
//
// All those fields will be included in the custom attributes of the evaluation context,
// if in the evaluation context you have a field with the same name,
// it will be overridden by the evaluationContextEnrichment.
// Default: nil
EvaluationContextEnrichment map[string]any `mapstructure:"evaluationContextEnrichment" koanf:"evaluationcontextenrichment"` //nolint: lll
// OpenTelemetryOtlpEndpoint (optional) is the endpoint of the OpenTelemetry collector
// Default: ""
OpenTelemetryOtlpEndpoint string `mapstructure:"openTelemetryOtlpEndpoint" koanf:"opentelemetryotlpendpoint"`
// PersistentFlagConfigurationFile (optional) if set GO Feature Flag will store flags configuration in this file
// to be able to serve the flags even if none of the retrievers is available during starting time.
//
// By default, the flag configuration is not persisted and stays on the retriever system. By setting a file here,
// you ensure that GO Feature Flag will always start with a configuration but which can be out-dated.
PersistentFlagConfigurationFile string `mapstructure:"persistentFlagConfigurationFile" koanf:"persistentflagconfigurationfile"` //nolint: lll
// OtelConfig is the configuration for the OpenTelemetry part of the relay proxy
OtelConfig OpenTelemetryConfiguration `mapstructure:"otel" koanf:"otel"`
// JaegerConfig is the configuration for the Jaeger sampling of the relay proxy
JaegerConfig JaegerSamplerConfiguration `mapstructure:"jaeger" koanf:"jaeger"`
// EnvVariablePrefix (optional) is the prefix we are using to load the environment variables
// By default we have no prefix
EnvVariablePrefix string `mapstructure:"envVariablePrefix" koanf:"envvariableprefix"`
// EnableBulkMetricFlagNames (optional) enables per-flag metrics for bulk evaluation endpoints.
// This adds flag_name labels to the all_flags_evaluations_total_with_flag metric.
// Default: false
EnableBulkMetricFlagNames bool `mapstructure:"enableBulkMetricFlagNames" koanf:"enablebulkmetricflagnames"`
// DisableFlagDetailsInStream (optional) removes flag definitions from WebSocket change payloads.
// Default: false
DisableFlagDetailsInStream bool `mapstructure:"disableFlagDetailsInStream" koanf:"disableflagdetailsinstream"`
// FlagSets is the list of flag sets configured.
// A flag set is a group of flags that can be used to configure the relay proxy.
// Each flag set can have its own API key, retrievers, notifiers and exporters.
// There is no inheritance between flag sets.
FlagSets []FlagSet `mapstructure:"flagsets" koanf:"flagsets"`
// ---------- Deprecated fields ----------
// ListenPort (optional) is the port we are using to start the proxy
//
// Deprecated: use Server.Port instead
ListenPort int `mapstructure:"listen" koanf:"listen"`
// MonitoringPort (optional) is the port we are using to expose the metrics and healthchecks
// If not set we will use the same port as the proxy
//
// Deprecated: use Server.MonitoringPort instead
MonitoringPort int `mapstructure:"monitoringPort" koanf:"monitoringport"`
// Deprecated: use Swagger.Enabled instead
EnableSwagger bool `mapstructure:"enableSwagger" koanf:"enableswagger"`
// Deprecated: use Swagger.Host instead
Host string `mapstructure:"host" koanf:"host"`
// Deprecated: use AuthorizedKeys instead
// APIKeys list of API keys that authorized to use endpoints
APIKeys []string `mapstructure:"apiKeys" koanf:"apikeys"` //nolint:gosec // G117
// StartAsAwsLambda (optional) if true, the relay proxy will start ready to be launched as AWS Lambda
//
// Deprecated: use `Server.Mode = lambda` instead
StartAsAwsLambda bool `mapstructure:"startAsAwsLambda" koanf:"startasawslambda"`
// AwsLambdaAdapter (optional) is the adapter to use when the relay proxy is started as an AWS Lambda.
// Possible values are "APIGatewayV1", "APIGatewayV2" and "ALB"
// Default: "APIGatewayV2"
//
// Deprecated: use `Server.LambdaAdapter` instead
AwsLambdaAdapter string `mapstructure:"awsLambdaAdapter" koanf:"awslambdaadapter"`
// AwsApiGatewayBasePath (optional) is the base path prefix for AWS API Gateway deployments.
// This is useful when deploying behind a non-root path like "/api" or "/dev/feature-flags".
// The relay proxy will strip this base path from incoming requests before processing.
// Example: if set to "/api/feature-flags", requests to "/api/feature-flags/health" will be processed as "/health"
// Default: ""
//
// Deprecated: use `Server.AwsApiGatewayBasePath` instead
AwsApiGatewayBasePath string `mapstructure:"awsApiGatewayBasePath" koanf:"awsapigatewaybasepath"`
// contains filtered or unexported fields
}
func (*Config) APIKeyExists ¶ added in v1.7.0
APIKeyExists is checking if an API Key exist in the relay proxy configuration
func (*Config) APIKeysAdminExists ¶ added in v1.28.0
APIKeysAdminExists is checking if an admin API Key exist in the relay proxy configuration
func (*Config) AddFlagSet ¶ added in v1.55.0
AddFlagSet adds a new flag set to the configuration. It returns an error if a flag set with the same name already exists.
func (*Config) AttachConfigChangeCallback ¶ added in v1.50.0
AttachConfigChangeCallback attaches a callback to be called when the configuration changes
func (*Config) EffectiveAwsApiGatewayBasePath ¶ added in v1.50.0
EffectiveAwsApiGatewayBasePath returns the AWS API Gateway base path, checking first the server config and then the top-level config, defaulting to empty string if not set.
func (*Config) EffectiveMonitoringPort ¶ added in v1.50.0
EffectiveMonitoringPort returns the monitoring port, checking first the top-level config and then the server config.
func (*Config) ForceReloadAPIKeys ¶ added in v1.50.0
func (c *Config) ForceReloadAPIKeys()
ForceReloadAPIKeys is forcing the reload of the API Keys. This is used to reload the API Keys when the configuration changes. The entire reload operation is atomic to prevent race conditions.
func (*Config) GetAPIKeys ¶ added in v1.50.0
GetAPIKeys returns a copy of the APIKeys with proper synchronization.
func (*Config) GetAuthorizedKeys ¶ added in v1.50.0
GetAuthorizedKeys returns a copy of the AuthorizedKeys with proper synchronization.
func (*Config) GetFlagSetAPIKeys ¶ added in v1.50.0
func (*Config) GetFlagSets ¶ added in v1.55.0
GetFlagSets returns a shallow copy of the configured flag sets. The copy is taken under the read lock so callers can safely iterate the result while the configuration is being reloaded concurrently.
func (*Config) IsAuthenticationEnabled ¶ added in v1.45.5
IsAuthenticationEnabled returns true if we need to be authenticated.
func (*Config) IsDebugEnabled ¶ added in v1.30.0
IsDebugEnabled returns true if the log level is debug
func (*Config) IsSwaggerEnabled ¶ added in v1.50.0
IsSwaggerEnabled is the function to check if the swagger is enabled. If the Swagger.Enabled is true, we return true. If the EnableSwagger is true, we return true. If both are false, we return false.
func (*Config) IsUsingFlagsets ¶ added in v1.50.0
IsUsingFlagsets returns true if the configuration is using flagsets
func (*Config) LambdaAdapter ¶ added in v1.50.0
func (c *Config) LambdaAdapter(logger *zap.Logger) LambdaAdapter
LambdaAdapter returns the lambda adapter, checking first the server config and then the top-level config, defaulting to APIGatewayV2 if not set.
func (*Config) RemoveFlagSet ¶ added in v1.55.0
RemoveFlagSet removes the flag set with the given name from the configuration. It returns an error if the flag set is not found.
func (*Config) ServerHost ¶ added in v1.50.0
ServerHost returns the server host, defaulting to "0.0.0.0" if not set.
func (*Config) ServerMode ¶ added in v1.50.0
func (c *Config) ServerMode(logger *zap.Logger) ServerMode
ServerMode returns the server mode, checking first the server config and then the top-level config, defaulting to HTTP if not set.
func (*Config) ServerPort ¶ added in v1.50.0
ServerPort returns the server port, checking first the server config and then the top-level config, defaulting to 1031 if not set.
func (*Config) SetAPIKeys
deprecated
added in
v1.50.0
func (*Config) SetAuthorizedKeys ¶ added in v1.50.0
SetAuthorizedKeys sets the authorized keys for the configuration
func (*Config) SetFlagSetAPIKeys ¶ added in v1.50.0
func (*Config) StopConfigChangeWatcher ¶ added in v1.50.0
StopConfigChangeWatcher stops the watcher for the configuration changes
func (*Config) SwaggerHost ¶ added in v1.50.0
SwaggerHost returns the swagger host. If the Swagger.Host is set, we return it. If the Host is set, we return it. If both are not set, we return "localhost".
func (*Config) UnixSocketPath ¶ added in v1.50.0
UnixSocketPath returns the unix socket path.
func (*Config) ZapLogLevel ¶ added in v1.30.0
ZapLogLevel returns the zap core level for the log level
type ConfigLoader ¶ added in v1.50.0
type ConfigLoader struct {
// contains filtered or unexported fields
}
func NewConfigLoader ¶ added in v1.50.0
func NewConfigLoader( cmdLineFlagSet *pflag.FlagSet, log *zap.Logger, version string, watchChanges bool) *ConfigLoader
NewConfigLoader creates a new ConfigLoader.
func (*ConfigLoader) AddConfigChangeCallback ¶ added in v1.50.0
func (c *ConfigLoader) AddConfigChangeCallback(callback func(newConfig *Config))
AddConfigChangeCallback adds a callback to be called when the configuration changes
func (*ConfigLoader) StopWatchChanges ¶ added in v1.50.0
func (c *ConfigLoader) StopWatchChanges() error
StopWatchChanges stops watching for changes in the configuration file
func (*ConfigLoader) ToConfig ¶ added in v1.50.0
func (c *ConfigLoader) ToConfig() (*Config, error)
ToConfig returns the configuration.
type ExporterConf ¶
type ExporterConf struct {
Kind ExporterKind `mapstructure:"kind" koanf:"kind"`
TracerName string `mapstructure:"tracerName" koanf:"tracername"`
OutputDir string `mapstructure:"outputDir" koanf:"outputdir"`
Format string `mapstructure:"format" koanf:"format"`
Filename string `mapstructure:"filename" koanf:"filename"`
CsvTemplate string `mapstructure:"csvTemplate" koanf:"csvtemplate"`
Bucket string `mapstructure:"bucket" koanf:"bucket"`
Path string `mapstructure:"path" koanf:"path"`
EndpointURL string `mapstructure:"endpointUrl" koanf:"endpointurl"`
Secret string `mapstructure:"secret" koanf:"secret"` //nolint:gosec
Meta map[string]string `mapstructure:"meta" koanf:"meta"`
LogFormat string `mapstructure:"logFormat" koanf:"logformat"`
FlushInterval int64 `mapstructure:"flushInterval" koanf:"flushinterval"`
MaxEventInMemory int64 `mapstructure:"maxEventInMemory" koanf:"maxeventinmemory"`
ParquetCompressionCodec string `mapstructure:"parquetCompressionCodec" koanf:"parquetcompressioncodec"`
Headers map[string][]string `mapstructure:"headers" koanf:"headers"`
QueueURL string `mapstructure:"queueUrl" koanf:"queueurl"`
Kafka kafkaexporter.Settings `mapstructure:"kafka" koanf:"kafka"`
ProjectID string `mapstructure:"projectID" koanf:"projectid"`
DatasetID string `mapstructure:"datasetID" koanf:"datasetid"`
TableName string `mapstructure:"tableName" koanf:"tablename"`
//nolint:gosec
GoogleCredentials string `mapstructure:"googleCredentials" koanf:"googlecredentials"`
AutoMigrate bool `mapstructure:"autoMigrate" koanf:"automigrate"`
Topic string `mapstructure:"topic" koanf:"topic"`
StreamArn string `mapstructure:"streamArn" koanf:"streamarn"`
StreamName string `mapstructure:"streamName" koanf:"streamname"`
AccountName string `mapstructure:"accountName" koanf:"accountname"`
AccountKey string `mapstructure:"accountKey" koanf:"accountkey"`
Container string `mapstructure:"container" koanf:"container"`
ExporterEventType string `mapstructure:"eventType" koanf:"eventtype"`
}
ExporterConf contains all the field to configure an exporter
func (*ExporterConf) IsValid ¶
func (c *ExporterConf) IsValid() error
type ExporterKind ¶
type ExporterKind string
const ( FileExporter ExporterKind = "file" WebhookExporter ExporterKind = "webhook" LogExporter ExporterKind = "log" S3Exporter ExporterKind = "s3" KinesisExporter ExporterKind = "kinesis" GoogleStorageExporter ExporterKind = "googleStorage" SQSExporter ExporterKind = "sqs" KafkaExporter ExporterKind = "kafka" PubSubExporter ExporterKind = "pubsub" BigQueryExporter ExporterKind = "bigquery" AzureExporter ExporterKind = "azureBlobStorage" OpenTelemetryExporter ExporterKind = "opentelemetry" )
func (ExporterKind) IsValid ¶
func (r ExporterKind) IsValid() error
IsValid is checking if the value is part of the enum
type FlagSet ¶ added in v1.45.5
type FlagSet struct {
CommonFlagSet `mapstructure:",inline" koanf:",squash"`
// APIKeys is the api keys for the flag set.
// This will add a new API keys to the list of authorizedKeys.evaluation keys.
// This property is madatory for every flagset, we will use it to filter the flag available.
APIKeys []string `mapstructure:"apiKeys" koanf:"apikeys"` //nolint:gosec // G117
// Name of the flagset.
// This allow to identify the flagset.
// Default: generated value
Name string `mapstructure:"name,omitempty" koanf:"name"`
}
FlagSet is the configuration for a flag set. A flag set is a collection of flags that are used to evaluate features. It is used to group flags together and to apply the same configuration to them. It is also used to apply the same API key to all the flags in the flag set.
type JaegerSampler ¶ added in v1.50.0
type JaegerSampler struct {
Manager JaegerSamplerManager `mapstructure:"manager" koanf:"manager"`
Refresh JaegerSamplerRefresh `mapstructure:"refresh" koanf:"refresh"`
Max JaegerSamplerMax `mapstructure:"max" koanf:"max"`
}
JaegerSampler is the configuration object to configure the sampling.
type JaegerSamplerConfiguration ¶ added in v1.37.0
type JaegerSamplerConfiguration struct {
Sampler JaegerSampler `mapstructure:"sampler" koanf:"sampler"`
}
JaegerSamplerConfiguration is the configuration object to configure the sampling. Most of the time this configuration is set using environment variables.
type JaegerSamplerManager ¶ added in v1.50.0
type JaegerSamplerManager struct {
Host JaegerSamplerManagerHost `mapstructure:"host" koanf:"host"`
}
JaegerSamplerManager is the configuration object to configure the manager of the sampling.
type JaegerSamplerManagerHost ¶ added in v1.50.0
type JaegerSamplerManagerHost struct {
Port string `mapstructure:"port" koanf:"port"`
}
JaegerSamplerManagerHost is the configuration object to configure the host of the manager of the sampling.
type JaegerSamplerMax ¶ added in v1.50.0
type JaegerSamplerMax struct {
Operations int `mapstructure:"operations" koanf:"operations"`
}
JaegerSamplerMax is the configuration object to configure the max of the sampling.
type JaegerSamplerRefresh ¶ added in v1.50.0
type JaegerSamplerRefresh struct {
Interval string `mapstructure:"interval" koanf:"interval"`
}
JaegerSamplerRefresh is the configuration object to configure the refresh of the sampling.
type LambdaAdapter ¶ added in v1.48.0
type LambdaAdapter = string
const ( LambdaAdapterAPIGatewayV1 LambdaAdapter = "APIGatewayV1" LambdaAdapterAPIGatewayV2 LambdaAdapter = "APIGatewayV2" LambdaAdapterALB LambdaAdapter = "ALB" )
type NotifierConf ¶
type NotifierConf struct {
Kind NotifierKind `mapstructure:"kind" koanf:"kind"`
// Deprecated: Use WebhookURL instead
SlackWebhookURL string `mapstructure:"slackWebhookUrl" koanf:"slackwebhookurl"`
EndpointURL string `mapstructure:"endpointUrl" koanf:"endpointurl"`
Secret string `mapstructure:"secret" koanf:"secret"` //nolint:gosec // G117
Meta map[string]string `mapstructure:"meta" koanf:"meta"`
Headers map[string][]string `mapstructure:"headers" koanf:"headers"`
WebhookURL string `mapstructure:"webhookUrl" koanf:"webhookurl"`
}
func (*NotifierConf) IsValid ¶
func (c *NotifierConf) IsValid() error
type NotifierKind ¶
type NotifierKind string
const ( SlackNotifier NotifierKind = "slack" MicrosoftTeamsNotifier NotifierKind = "microsoftteams" WebhookNotifier NotifierKind = "webhook" DiscordNotifier NotifierKind = "discord" )
func (NotifierKind) IsValid ¶
func (r NotifierKind) IsValid() error
IsValid is checking if the value is part of the enum
type OfrepEventStream ¶ added in v1.56.0
type OfrepEventStream struct {
// BaseURL (optional) is the public base URL clients should use to reach the relay proxy,
// for example https://gofeatureflag.example.com. The path of the SSE endpoint is appended
// automatically. When empty, the eventStreams field is not added to the response.
BaseURL string `mapstructure:"baseUrl" koanf:"baseurl"`
// InactivityDelaySec (optional) is advertised to the client as the delay in seconds after
// which it should consider the stream inactive. When 0 the field is omitted.
InactivityDelaySec int `mapstructure:"inactivityDelaySec" koanf:"inactivitydelaysec"`
}
OfrepEventStream holds the configuration used to advertise the flag-change SSE endpoint in the OFREP bulk evaluation response (OpenFeature ADR-0008).
func (OfrepEventStream) IsEnabled ¶ added in v1.56.0
func (o OfrepEventStream) IsEnabled() bool
IsEnabled returns true if the eventStreams field should be added to the OFREP bulk evaluation response.
func (OfrepEventStream) IsValid ¶ added in v1.56.0
func (o OfrepEventStream) IsValid() error
IsValid checks that the configuration is valid.
type OpenTelemetryConfiguration ¶ added in v1.37.0
type OpenTelemetryConfiguration struct {
SDK struct {
Disabled bool `mapstructure:"disabled" koanf:"disabled"`
} `mapstructure:"sdk" koanf:"sdk"`
Exporter OtelExporter `mapstructure:"exporter" koanf:"exporter"`
Service struct {
Name string `mapstructure:"name" koanf:"name"`
} `mapstructure:"service" koanf:"service"`
Traces struct {
Sampler string `mapstructure:"sampler" koanf:"sampler"`
} `mapstructure:"traces" koanf:"traces"`
Resource OtelResource `mapstructure:"resource" koanf:"resource"`
}
OpenTelemetryConfiguration is the configuration for the OpenTelemetry part of the relay proxy It is used to configure the OpenTelemetry SDK and the OpenTelemetry Exporter Most of the time this configuration is set using environment variables.
type OtelExporter ¶ added in v1.38.0
type OtelExporter struct {
Otlp OtelExporterOtlp `mapstructure:"otlp" koanf:"otlp"`
}
type OtelExporterOtlp ¶ added in v1.38.0
type OtelResource ¶ added in v1.38.0
type Server ¶ added in v1.48.0
type Server struct {
// Mode is the server mode.
// default: http
Mode ServerMode `mapstructure:"mode" koanf:"mode"`
// Host is the server host.
// default: 0.0.0.0
Host string `mapstructure:"host" koanf:"host"`
// Port is the server port.
// default: 1031
Port int `mapstructure:"port" koanf:"port"`
// MonitoringPort is the monitoring port. It can be specified only if the server mode is HTTP.
// default: none, it will use the same as server port.
MonitoringPort int `mapstructure:"monitoringPort" koanf:"monitoringport"`
// UnixSocket is the server unix socket path.
UnixSocketPath string `mapstructure:"unixSocketPath" koanf:"unixsocketpath"`
// AWS Lambda configuration
// LambdaAdapter is the adapter to use when the relay proxy is started as an AWS Lambda.
// default: APIGatewayV2
LambdaAdapter LambdaAdapter `mapstructure:"awsLambdaAdapter" koanf:"awsLambdaAdapter"`
// AwsApiGatewayBasePath (optional) is the base path prefix for AWS API Gateway deployments.
// This is useful when deploying behind a non-root path like "/api" or "/dev/feature-flags".
// The relay proxy will strip this base path from incoming requests before processing.
// Example: if set to "/api/feature-flags", requests to "/api/feature-flags/health" will be processed as "/health"
// Default: ""
AwsApiGatewayBasePath string `mapstructure:"awsApiGatewayBasePath" koanf:"awsapigatewaybasepath"`
}
type ServerMode ¶ added in v1.48.0
type ServerMode = string
const ( // ServerModeHTTP is the HTTP server mode. ServerModeHTTP ServerMode = "http" // ServerModeLambda is the AWS Lambda server mode. ServerModeLambda ServerMode = "lambda" // ServerModeUnixSocket is the Unix Socket server mode. ServerModeUnixSocket ServerMode = "unixsocket" )