Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetConfigPath ¶
func GetConfigPath() string
GetConfigPath returns the platform-specific default config file path
func SetExplicitConfigFile ¶ added in v1.6.0
func SetExplicitConfigFile(path string)
SetExplicitConfigFile records the highest-precedence config file path that the loader should merge on top of the default config sources. An empty string clears the override.
Types ¶
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
Loader handles configuration loading from multiple sources
func NewLoaderWithHome ¶ added in v1.6.1
NewLoaderWithHome allows overriding how the home directory is resolved (useful in tests).
func (*Loader) Load ¶
Load loads configuration from all sources with proper precedence Precedence: CLI Flags > Environment Variables > Config File > Defaults
func (*Loader) LoadDefaults ¶
func (l *Loader) LoadDefaults()
LoadDefaults sets sensible default values
func (*Loader) LoadFromEnv ¶
func (l *Loader) LoadFromEnv()
LoadFromEnv loads configuration from environment variables This is automatically handled by viper with AutomaticEnv() in root.go
func (*Loader) LoadFromFile ¶
LoadFromFile loads configuration from YAML file
func (*Loader) LoadFromFlags ¶
func (l *Loader) LoadFromFlags()
LoadFromFlags loads configuration from CLI flags This is automatically handled by viper flag binding in root.go