Documentation
¶
Overview ¶
Package config contains all the configuration attributes for running Optimizely Agent
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIConfig ¶
type APIConfig struct {
Auth ServiceAuthConfig `json:"-"`
CORS CORSConfig `json:"cors"`
MaxConns int `json:"maxConns"`
Port string `json:"port"`
EnableNotifications bool `json:"enableNotifications"`
EnableOverrides bool `json:"enableOverrides"`
}
APIConfig holds the REST API configuration
type AdminConfig ¶
type AdminConfig struct {
Auth ServiceAuthConfig `json:"-"`
Port string `json:"port"`
}
AdminConfig holds the configuration for the admin web interface
type AgentConfig ¶
type AgentConfig struct {
Version string `json:"version"`
Author string `json:"author"`
Name string `json:"name"`
SDKKeys []string `yaml:"sdkKeys" json:"sdkKeys"`
Admin AdminConfig `json:"admin"`
API APIConfig `json:"api"`
Log LogConfig `json:"log"`
Client ClientConfig `json:"client"`
Server ServerConfig `json:"server"`
Webhook WebhookConfig `json:"webhook"`
}
AgentConfig is the top level configuration struct
func NewDefaultConfig ¶
func NewDefaultConfig() *AgentConfig
NewDefaultConfig returns the default configuration for Optimizely Agent
type CORSConfig ¶ added in v1.1.0
type CORSConfig struct {
AllowedOrigins []string `json:"allowedOrigins"`
AllowedMethods []string `json:"allowedMethods"`
AllowedHeaders []string `json:"allowedHeaders"`
ExposedHeaders []string `json:"exposedHeaders"`
AllowedCredentials bool `json:"allowedCredentials"`
MaxAge int `json:"maxAge"`
}
CORSConfig holds the CORS middleware configuration
type ClientConfig ¶ added in v0.13.0
type ClientConfig struct {
PollingInterval time.Duration `json:"pollingInterval"`
BatchSize int `json:"batchSize" default:"10"`
QueueSize int `json:"queueSize" default:"1000"`
FlushInterval time.Duration `json:"flushInterval" default:"30s"`
DatafileURLTemplate string `json:"datafileURLTemplate"`
EventURL string `json:"eventURL"`
}
ClientConfig holds the configuration options for the Optimizely Client.
type OAuthClientCredentials ¶ added in v0.12.0
type OAuthClientCredentials struct {
ID string `yaml:"id"`
SecretHash string `yaml:"secretHash"`
SDKKeys []string `yaml:"sdkKeys"`
}
OAuthClientCredentials are used for issuing access tokens
type ServerConfig ¶
type ServerConfig struct {
ReadTimeout time.Duration `json:"readTimeout"`
WriteTimeout time.Duration `json:"writeTimeout"`
CertFile string `json:"certFile"`
KeyFile string `json:"keyFile"`
DisabledCiphers []string `json:"disabledCiphers"`
HealthCheckPath string `json:"healthCheckPath"`
}
ServerConfig holds the global http server configs
type ServiceAuthConfig ¶ added in v0.12.0
type ServiceAuthConfig struct {
Clients []OAuthClientCredentials `yaml:"clients" json:"-"`
HMACSecrets []string `yaml:"hmacSecrets" json:"-"`
TTL time.Duration `yaml:"ttl" json:"-"`
JwksURL string `yaml:"jwksURL"`
JwksUpdateInterval time.Duration `yaml:"jwksUpdateInterval"`
}
ServiceAuthConfig holds the authentication configuration for a particular service
type WebhookConfig ¶
type WebhookConfig struct {
Port string `json:"port"`
Projects map[int64]WebhookProject `json:"projects"`
}
WebhookConfig holds configuration for Optimizely Webhooks
type WebhookProject ¶
type WebhookProject struct {
SDKKeys []string `json:"sdkKeys"`
Secret string `json:"-"`
SkipSignatureCheck bool `json:"skipSignatureCheck" default:"false"`
}
WebhookProject holds the configuration for a single Project webhook