Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Validate ¶ added in v1.1.0
func Validate(cfg SMTPConfig) error
Validate checks that all required SMTP fields are present. Call this immediately after LoadConfig to catch misconfigured deployments before any recipients are loaded or any SMTP connections are attempted.
Types ¶
type AppConfig ¶
type AppConfig struct {
SMTP SMTPConfig `json:"smtp"`
TimeoutMs int `json:"timeout_ms"` // smtp timeout in milliseconds
}
func LoadConfig ¶
LoadConfig reads JSON config from disk and returns a parsed AppConfig. It never terminates the process; callers should handle returned errors.
type SMTPConfig ¶
type SMTPConfig struct {
Host string `json:"host"`
Port int `json:"port"`
Username string `json:"username"`
Password string `json:"password"`
From string `json:"from"`
TLSCertFile string `json:"tls_cert_file,omitempty"` // Path to custom CA certificate
TLSKeyFile string `json:"tls_key_file,omitempty"` // Path to client certificate
InsecureTLS bool `json:"insecure_tls,omitempty"` // Skip TLS verification (use with caution)
// DialTimeout overrides the default 10-second TCP connect timeout.
// Zero means use the default.
DialTimeout time.Duration `json:"-"` // set from CLI flag, not the JSON file
}
Click to show internal directories.
Click to hide internal directories.