Documentation
¶
Overview ¶
Package config provides shared configuration primitives for the adaouat CLIs: a strict YAML loader, app-name-parameterized path resolution, and structured validation errors. Schemas, defaults, and merge semantics stay in the apps.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrEmptyConfig = errors.New("config: empty config file")
ErrEmptyConfig is returned by Decode/Load when the input has no YAML document (an empty file), so callers can classify it with errors.Is instead of guessing from a raw "EOF".
Functions ¶
Types ¶
type Resolver ¶
type Resolver struct {
App string
}
Resolver resolves an app's config file path from the standard precedence. App is the lowercase CLI name, e.g. "heraut" → HERAUT_FILE, .config/heraut.yml, .heraut.yml.
func (Resolver) InitDest ¶
InitDest returns where a new config should be written: .config/<app>.yml if a .config/ directory exists, else .<app>.yml.
func (Resolver) Label ¶
Label returns a human-readable description of a Source, for messages like "config loaded from X (from <label>)".
type ValidationError ¶
ValidationError describes a single semantic validation failure: the config Path that failed, a Message, and an optional remediation Hint.
func (ValidationError) Error ¶
func (e ValidationError) Error() string
type ValidationErrors ¶
type ValidationErrors []ValidationError
ValidationErrors is a list of ValidationError that implements error.
func (ValidationErrors) Error ¶
func (ve ValidationErrors) Error() string