Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
General GeneralConfig `koanf:"general"`
DNS DNSConfig `koanf:"dns"`
HTTP HTTPConfig `koanf:"http"`
HTTPS HTTPSConfig `koanf:"https"`
Logging LoggingConfig `koanf:"logging"`
State StateConfig `koanf:"state"`
Listeners []ListenerConfig `koanf:"listeners"`
}
type GeneralConfig ¶
type HTTPConfig ¶
type HTTPSConfig ¶
type ListenerConfig ¶
type ListenerConfig struct {
Name string `koanf:"name"`
Enabled *bool `koanf:"enabled"`
Type string `koanf:"type"`
Listen string `koanf:"listen"`
Handler string `koanf:"handler"`
ReadTimeout time.Duration `koanf:"read_timeout"`
TLS bool `koanf:"tls"`
TLSCert string `koanf:"tls_cert"`
TLSKey string `koanf:"tls_key"`
Capture *bool `koanf:"capture"`
}
ListenerConfig is a single [[listeners]] entry; Enabled/Capture default to true when unset.
func (ListenerConfig) IsEnabled ¶
func (c ListenerConfig) IsEnabled() bool
func (ListenerConfig) ShouldCapture ¶
func (c ListenerConfig) ShouldCapture() bool
type LoadResult ¶
func LoadOptional ¶
func LoadOptional(configPath string, overrides map[string]any) (LoadResult, error)
LoadOptional never creates a config file, unlike LoadOrCreate
func LoadOrCreate ¶
func LoadOrCreate(configPath string) (LoadResult, error)
func LoadOrCreateWithOverrides ¶
func LoadOrCreateWithOverrides(configPath string, overrides map[string]any) (LoadResult, error)
LoadOrCreateWithOverrides loads defaults, then the on-disk config file, then applies the provided flat overrides (dot-delimited keys).
Validation is intentionally not run here; callers should map the resulting config into the isolated service configs (e.g. dnsserver.Config) and call Validate() once on those structs before starting services.
type LoggingConfig ¶
type StateConfig ¶
type StateConfig struct {
TotalLimit string `koanf:"total_limit"`
}
empty TotalLimit means the state package default
Click to show internal directories.
Click to hide internal directories.