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"`
SMTP SMTPConfig `koanf:"smtp"`
SMTPS SMTPSConfig `koanf:"smtps"`
Logging LoggingConfig `koanf:"logging"`
}
type GeneralConfig ¶
type HTTPConfig ¶
type HTTPSConfig ¶
type LoadResult ¶
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 SMTPConfig ¶
type SMTPConfig struct {
Enabled bool `koanf:"enabled"`
Addr string `koanf:"addr"` // ":25"
Domain string `koanf:"domain"` // "localhost"
WriteTimeout int `koanf:"write_timeout"` // 10 seconds
ReadTimeout int `koanf:"read_timeout"` // 10 seconds
MaxMessageBytes int `koanf:"max_message_bytes"` // 1024 * 1024
MaxRecipients int `koanf:"max_recipients"` // 50
RequireAuth bool `koanf:"require_auth"` // false
AllowInsecureAuth bool `koanf:"allow_insecure_auth"` // true
}
type SMTPSConfig ¶
type SMTPSConfig struct {
Enabled bool `koanf:"enabled"`
Addr string `koanf:"addr"` // ":465"
Domain string `koanf:"domain"` // "localhost"
WriteTimeout int `koanf:"write_timeout"` // 10 seconds
ReadTimeout int `koanf:"read_timeout"` // 10 seconds
MaxMessageBytes int `koanf:"max_message_bytes"` // 1024 * 1024
MaxRecipients int `koanf:"max_recipients"` // 50
RequireAuth bool `koanf:"require_auth"` // false
AllowInsecureAuth bool `koanf:"allow_insecure_auth"` // false (secure)
Cert string `koanf:"cert"` // Optional TLS cert
Key string `koanf:"key"` // Optional TLS key
}
Click to show internal directories.
Click to hide internal directories.