Documentation
¶
Overview ¶
Package config provides minimal helpers for loading application configuration files. It intentionally does not implement overlay, merging, validation, profile chains, env interpolation, or file watching — those are domain-specific policies.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Find ¶
Find walks up from startDir looking for filename. It stops at the filesystem root. Returns the absolute path of the first regular file found, or "" when none exists. An empty startDir uses the current working directory.
func Load ¶
Load reads each path in order and decodes into dst. Fields present in later files override fields present in earlier files; fields absent from later files are left untouched. Unknown keys are rejected. Format is selected by extension: .yaml/.yml (yaml.v3), .json (encoding/json). Any other extension returns xerr.BadRequest. An empty path is skipped. An empty file is a no-op.
func LoadFromDir ¶
LoadFromDir combines Find and Load. It returns nil when no file named filename exists anywhere between startDir and the filesystem root — callers use this when "no config file" means "keep defaults". A present-but-unreadable or malformed file still returns an error.
Types ¶
This section is empty.