Versions in this module Expand all Collapse all v1 v1.0.1 May 11, 2022 v1.0.0 May 10, 2022 Changes in this version + var KeyDelimiter = "." + func Cast(name string, fn TypeConversionFunc) (interface{}, bool) + func CastOrDefault(name string, defaultValue interface{}, fn TypeConversionFunc) interface + func CombinePath(pathSegments ...string) string + func ExtractMap(data interface{}, path string) map[string]*ExtractedValue + func ExtractStructToMap(data interface{}, path string) map[string]*ExtractedValue + func GetConfiguration(providers []Provider, name string) (string, bool) + func GetParentPath(path string) (string, bool) + func GetSectionKey(path string) string + func GetString(name string) (string, bool) + func GetStringOrDefault(name string, defaultValue string) string + func Init(fn func(Builder)) + func Segment(key string, prefixLength int) string + type Builder interface + AddSource func(source Source) Builder + BuildRoot func() Root + Properties func() map[string]interface{} + Sources func() []Source + func NewBuilder() Builder + type Configuration interface + GetChildren func() []Section + GetExtracted func(name string) (*ExtractedValue, bool) + GetSection func(name string) Section + GetString func(name string) (string, bool) + type ConfigurationBuilder struct + func (builder *ConfigurationBuilder) AddSource(source Source) Builder + func (builder *ConfigurationBuilder) BuildRoot() Root + func (builder *ConfigurationBuilder) Properties() map[string]interface{} + func (builder *ConfigurationBuilder) Sources() []Source + type ConfigurationProvider struct + Data map[string]*ExtractedValue + func NewConfigurationProvider() *ConfigurationProvider + func (provider *ConfigurationProvider) GetChildKeys(path string, earlierKeys ...string) []string + func (provider *ConfigurationProvider) GetExtracted(name string) (*ExtractedValue, bool) + func (provider *ConfigurationProvider) GetString(name string) (string, bool) + func (provider *ConfigurationProvider) Load() error + type ConfigurationRoot struct + Providers []Provider + func NewRoot(providers []Provider) *ConfigurationRoot + func (root *ConfigurationRoot) GetChildren() []Section + func (root *ConfigurationRoot) GetExtracted(name string) (*ExtractedValue, bool) + func (root *ConfigurationRoot) GetProviders() []Provider + func (root *ConfigurationRoot) GetSection(name string) Section + func (root *ConfigurationRoot) GetString(name string) (string, bool) + func (root *ConfigurationRoot) Reload() error + type ConfigurationSection struct + func NewSection(root Root, path string) *ConfigurationSection + func (section *ConfigurationSection) Bind(recv interface{}) error + func (section *ConfigurationSection) GetChildren() []Section + func (section *ConfigurationSection) GetExtracted(name string) (*ExtractedValue, bool) + func (section *ConfigurationSection) GetName() string + func (section *ConfigurationSection) GetPath() string + func (section *ConfigurationSection) GetRaw() (interface{}, bool) + func (section *ConfigurationSection) GetSection(name string) Section + func (section *ConfigurationSection) GetString(name string) (string, bool) + func (section *ConfigurationSection) GetValue() (string, bool) + type ExtractedValue struct + Name string + Raw interface{} + Value string + func GetConfigExtractedValue(providers []Provider, name string) (*ExtractedValue, bool) + func NewExtractedValue(name string, value string, raw interface{}) *ExtractedValue + type MemoryProvider struct + func NewMemoryProvider(source *MemorySource) *MemoryProvider + func (provider *MemoryProvider) Add(key, value string) + type MemorySource struct + InitialData map[string]string + func EnvironmentVariable(prefix string) *MemorySource + func Memory(initialData map[string]string) *MemorySource + func (source *MemorySource) BuildProvider(builder Builder) Provider + type Provider interface + GetChildKeys func(path string, earlierKeys ...string) []string + GetExtracted func(name string) (*ExtractedValue, bool) + GetString func(name string) (string, bool) + Load func() error + type Root interface + GetProviders func() []Provider + Reload func() error + func ConfigRoot() Root + type Section interface + Bind func(recv interface{}) error + GetName func() string + GetPath func() string + GetRaw func() (interface{}, bool) + GetValue func() (string, bool) + func GetChildrenFromRoot(root Root, path string) []Section + func GetSection(name string) Section + type Source interface + BuildProvider func(builder Builder) Provider + type TypeConversionFunc func(string) (interface{}, error) + var BooleanConversion TypeConversionFunc = func(s string) (interface{}, error) { ... } + var FloatConversion TypeConversionFunc = func(s string) (interface{}, error) { ... } + var IntConversion TypeConversionFunc = func(s string) (interface{}, error) { ... }