Documentation
¶
Index ¶
- Constants
- Variables
- func DecodeTLSCipherSuiteHookFunc(from reflect.Type, to reflect.Type, data any) (any, error)
- func DecodeTLSMinVersionHookFunc(from reflect.Type, to reflect.Type, data any) (any, error)
- func StringToByteSizeHookFunc() mapstructure.DecodeHookFunc
- func ValidateConfig(configPath string) error
- type BufferLimit
- type CORS
- type CacheConfig
- type Configuration
- type ConfigurationPath
- type ConnectionsLimit
- type DefaultRule
- type EnvVarPrefix
- type KeyStore
- type LogFormat
- type LoggingConfig
- type Mechanism
- type MechanismConfig
- type MechanismPrototypes
- type MetricsConfig
- type OperationMode
- type ProfilingConfig
- type RespondConfig
- type ResponseOverride
- type RuleProviders
- type ServeConfig
- type ServiceConfig
- type TLS
- type TLSCipherSuites
- type TLSMinVersion
- type Timeout
- type TracingConfig
- type TrustStore
Constants ¶
View Source
const ( SpanProcessorSimple = "simple" SpanProcessorBatch = "batch" )
Variables ¶
View Source
var Module = fx.Options( fx.Provide(NewConfiguration), fx.Provide(LogConfiguration), )
Functions ¶
func StringToByteSizeHookFunc ¶
func StringToByteSizeHookFunc() mapstructure.DecodeHookFunc
func ValidateConfig ¶
Types ¶
type BufferLimit ¶
type CORS ¶
type CORS struct {
AllowedOrigins []string `koanf:"allowed_origins"`
AllowedMethods []string `koanf:"allowed_methods"`
AllowedHeaders []string `koanf:"allowed_headers"`
ExposedHeaders []string `koanf:"exposed_headers"`
AllowCredentials bool `koanf:"allow_credentials"`
MaxAge time.Duration `koanf:"max_age,string"`
}
type CacheConfig ¶
type Configuration ¶
type Configuration struct {
Serve ServeConfig `koanf:"serve"`
Log LoggingConfig `koanf:"log"`
Tracing TracingConfig `koanf:"tracing"`
Metrics MetricsConfig `koanf:"metrics"`
Profiling ProfilingConfig `koanf:"profiling"`
Cache CacheConfig `koanf:"cache"`
Prototypes *MechanismPrototypes `koanf:"mechanisms,omitempty"`
Default *DefaultRule `koanf:"default_rule,omitempty"`
Providers RuleProviders `koanf:"providers,omitempty"`
SecretsReloadEnabled bool `koanf:"secrets_reload_enabled"`
}
func NewConfiguration ¶
func NewConfiguration(envPrefix EnvVarPrefix, configFile ConfigurationPath) (*Configuration, error)
type ConfigurationPath ¶
type ConfigurationPath string
type ConnectionsLimit ¶
type DefaultRule ¶
type DefaultRule struct {
BacktrackingEnabled bool `koanf:"backtracking_enabled"`
Execute []MechanismConfig `koanf:"execute"`
ErrorHandler []MechanismConfig `koanf:"on_error"`
}
type EnvVarPrefix ¶
type EnvVarPrefix string
type LoggingConfig ¶
type LoggingConfig struct {
Format LogFormat `koanf:"format,string"`
Level zerolog.Level `koanf:"level,string"`
}
func LogConfiguration ¶
func LogConfiguration(configuration *Configuration) LoggingConfig
type Mechanism ¶
type Mechanism struct {
ID string `koanf:"id"`
Type string `koanf:"type"`
Config MechanismConfig `koanf:"config"`
Condition string `koanf:"if"`
}
type MechanismConfig ¶
func (*MechanismConfig) DeepCopyInto ¶
func (in *MechanismConfig) DeepCopyInto(out *MechanismConfig)
type MechanismPrototypes ¶
type MetricsConfig ¶
type MetricsConfig struct {
Enabled bool `koanf:"enabled"`
}
func (MetricsConfig) Address ¶
func (c MetricsConfig) Address() string
type ProfilingConfig ¶
type ProfilingConfig struct {
Enabled bool `koanf:"enabled"`
Host string `koanf:"host"`
Port int `koanf:"port"`
}
func (ProfilingConfig) Address ¶
func (c ProfilingConfig) Address() string
type RespondConfig ¶
type RespondConfig struct {
Verbose bool `koanf:"verbose"`
With struct {
Accepted ResponseOverride `koanf:"accepted"`
ArgumentError ResponseOverride `koanf:"argument_error"`
AuthenticationError ResponseOverride `koanf:"authentication_error"`
AuthorizationError ResponseOverride `koanf:"authorization_error"`
CommunicationError ResponseOverride `koanf:"communication_error"`
InternalError ResponseOverride `koanf:"internal_error"`
NoRuleError ResponseOverride `koanf:"no_rule_error"`
} `koanf:"with"`
}
type ResponseOverride ¶
type ResponseOverride struct {
Code int `koanf:"code"`
}
type RuleProviders ¶
type ServeConfig ¶
type ServeConfig struct {
Proxy ServiceConfig `koanf:"proxy"`
Decision ServiceConfig `koanf:"decision"`
Management ServiceConfig `koanf:"management"`
}
type ServiceConfig ¶
type ServiceConfig struct {
Host string `koanf:"host"`
Port int `koanf:"port"`
Timeout Timeout `koanf:"timeout"`
BufferLimit BufferLimit `koanf:"buffer_limit"`
ConnectionsLimit ConnectionsLimit `koanf:"connections_limit"`
CORS *CORS `koanf:"cors,omitempty"`
TLS *TLS `koanf:"tls,omitempty"`
TrustedProxies *[]string `koanf:"trusted_proxies,omitempty"`
Respond RespondConfig `koanf:"respond"`
}
func (ServiceConfig) Address ¶
func (c ServiceConfig) Address() string
type TLS ¶
type TLS struct {
KeyStore KeyStore `koanf:"key_store" mapstructure:"key_store"`
KeyID string `koanf:"key_id" mapstructure:"key_id"`
CipherSuites TLSCipherSuites `koanf:"cipher_suites" mapstructure:"cipher_suites"`
MinVersion TLSMinVersion `koanf:"min_version" mapstructure:"min_version"`
}
type TLSCipherSuites ¶
type TLSCipherSuites []uint16
func (TLSCipherSuites) OrDefault ¶
func (s TLSCipherSuites) OrDefault() []uint16
type TLSMinVersion ¶
type TLSMinVersion uint16
func (TLSMinVersion) OrDefault ¶
func (v TLSMinVersion) OrDefault() uint16
type TracingConfig ¶
type TrustStore ¶
type TrustStore struct {
Path string `koanf:"path" mapstructure:"path"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.