Documentation ¶
Index ¶
- Constants
- Variables
- func ValidateConfig(configPath string) error
- type CORS
- type CacheConfig
- type Configuration
- type ConfigurationPath
- type DefaultRule
- type EnvVarPrefix
- type KeyStore
- type LogFormat
- type LoggingConfig
- type Mechanism
- type MechanismConfig
- type MechanismPrototypes
- type MetricsConfig
- type ProfilingConfig
- type RespondConfig
- type ResponseOverride
- type RuleProviders
- type Rules
- type ServeConfig
- type ServiceConfig
- type SignerConfig
- type TLS
- type TLSCipherSuites
- type TLSMinVersion
- type Timeout
- type TracingConfig
Constants ¶
View Source
const ( SpanProcessorSimple = "simple" SpanProcessorBatch = "batch" )
Variables ¶
View Source
var Module = fx.Options( fx.Provide(NewConfiguration), fx.Provide(LogConfiguration), )
nolint
Functions ¶
func ValidateConfig ¶
Types ¶
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 CacheConfig struct {
Type string `koanf:"type"`
}
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"` Signer SignerConfig `koanf:"signer"` Cache CacheConfig `koanf:"cache"` Rules Rules `koanf:"rules,omitempty"` }
func NewConfiguration ¶
func NewConfiguration(envPrefix EnvVarPrefix, configFile ConfigurationPath) (*Configuration, error)
type ConfigurationPath ¶
type ConfigurationPath string
type DefaultRule ¶
type DefaultRule struct { Methods []string `koanf:"methods"` 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"` }
type MechanismConfig ¶
func (*MechanismConfig) DeepCopyInto ¶
func (in *MechanismConfig) DeepCopyInto(out *MechanismConfig)
type MechanismPrototypes ¶
type MetricsConfig ¶
type MetricsConfig struct { Enabled bool `koanf:"enabled"` Host string `koanf:"host"` Port int `koanf:"port"` MetricsPath string `koanf:"metrics_path"` }
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"` BadMethodError ResponseOverride `koanf:"method_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 Rules ¶
type Rules struct { Prototypes *MechanismPrototypes `koanf:"mechanisms,omitempty"` Default *DefaultRule `koanf:"default,omitempty"` Providers RuleProviders `koanf:"providers,omitempty"` }
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"` 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 SignerConfig ¶
type TLS ¶
type TLS struct { KeyStore KeyStore `koanf:"key_store"` KeyID string `koanf:"key_id"` CipherSuites TLSCipherSuites `koanf:"cipher_suites"` MinVersion TLSMinVersion `koanf:"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 ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.