Versions in this module Expand all Collapse all v0 v0.1.0 Oct 2, 2026 Changes in this version + var ErrNotFoundInSource = errors.New("not found in source") + func Parse(cfg any) error + type LookupFunc func(key string, parents []string) (string, bool) + type MapSource struct + func NewMapSource(tag string, delegate map[string]any) MapSource + func (m MapSource) GetBool(key string, parents []string) (bool, error) + func (m MapSource) GetBoolMap(key string, parents []string) (map[string]bool, error) + func (m MapSource) GetBoolSlice(key string, parents []string) ([]bool, error) + func (m MapSource) GetFloat(key string, parents []string) (float64, error) + func (m MapSource) GetFloatMap(key string, parents []string) (map[string]float64, error) + func (m MapSource) GetFloatSlice(key string, parents []string) ([]float64, error) + func (m MapSource) GetInt(key string, parents []string) (int, error) + func (m MapSource) GetIntMap(key string, parents []string) (map[string]int, error) + func (m MapSource) GetIntSlice(key string, parents []string) ([]int, error) + func (m MapSource) GetString(key string, parents []string) (string, error) + func (m MapSource) GetStringMap(key string, parents []string) (map[string]string, error) + func (m MapSource) GetStringSlice(key string, parents []string) ([]string, error) + func (m MapSource) GetUint(key string, parents []string) (uint, error) + func (m MapSource) GetUintMap(key string, parents []string) (map[string]uint, error) + func (m MapSource) GetUintSlice(key string, parents []string) ([]uint, error) + func (m MapSource) Tag() string + type Option func(p *Parser) + func WithSources(sources ...Source) Option + func WithTag(tag string) Option + type Parser struct + func NewParser(opts ...Option) Parser + func (p Parser) Parse(cfg any) error + type Source interface + GetBool func(key string, parents []string) (bool, error) + GetBoolMap func(key string, parents []string) (map[string]bool, error) + GetBoolSlice func(key string, parents []string) ([]bool, error) + GetFloat func(key string, parents []string) (float64, error) + GetFloatMap func(key string, parents []string) (map[string]float64, error) + GetFloatSlice func(key string, parents []string) ([]float64, error) + GetInt func(key string, parents []string) (int, error) + GetIntMap func(key string, parents []string) (map[string]int, error) + GetIntSlice func(key string, parents []string) ([]int, error) + GetString func(key string, parents []string) (string, error) + GetStringMap func(key string, parents []string) (map[string]string, error) + GetStringSlice func(key string, parents []string) ([]string, error) + GetUint func(key string, parents []string) (uint, error) + GetUintMap func(key string, parents []string) (map[string]uint, error) + GetUintSlice func(key string, parents []string) ([]uint, error) + Tag func() string + var Default Source = NewStringSource("default", func(key string, _ []string) (string, bool) { ... }) + var Environment Source = NewStringSource("env", func(key string, _ []string) (string, bool) { ... }) + func NewCliSource(tag string, args []string) Source + type StringSource struct + func NewStringSource(tag string, lookup LookupFunc) StringSource + func (s StringSource) GetBool(key string, parents []string) (bool, error) + func (s StringSource) GetBoolMap(key string, parents []string) (map[string]bool, error) + func (s StringSource) GetBoolSlice(key string, parents []string) ([]bool, error) + func (s StringSource) GetFloat(key string, parents []string) (float64, error) + func (s StringSource) GetFloatMap(key string, parents []string) (map[string]float64, error) + func (s StringSource) GetFloatSlice(key string, parents []string) ([]float64, error) + func (s StringSource) GetInt(key string, parents []string) (int, error) + func (s StringSource) GetIntMap(key string, parents []string) (map[string]int, error) + func (s StringSource) GetIntSlice(key string, parents []string) ([]int, error) + func (s StringSource) GetString(key string, parents []string) (string, error) + func (s StringSource) GetStringMap(key string, parents []string) (map[string]string, error) + func (s StringSource) GetStringSlice(key string, parents []string) ([]string, error) + func (s StringSource) GetUint(key string, parents []string) (uint, error) + func (s StringSource) GetUintMap(key string, parents []string) (map[string]uint, error) + func (s StringSource) GetUintSlice(key string, parents []string) ([]uint, error) + func (s StringSource) Tag() string