Documentation
¶
Index ¶
- func AddFirst(cc cfg.Configurer)
- func AddLast(cc cfg.Configurer)
- func Alias(virtual, real string)
- func AutoFind(name, subfolderName string) error
- func CustomMap(src map[string]interface{})
- func EnableCustomFlags(f *goflag.FlagSet)
- func EnableCustomPFlags(f *gopflag.FlagSet)
- func EnableFlags()
- func EnablePFlags()
- func EnablePlaceholdersInFile()
- func EnableValidation()
- func Has(key string) bool
- func INIAutoFind(filename, subfolderName string)
- func INIFile(names ...string)
- func JSONAutoFind(filename, subfolderName string)
- func JSONFile(names ...string)
- func KeyFunc(key string) func(interface{}) error
- func MustValidate()
- func OrDefault(c cfg.Configurer) cfg.Configurer
- func TOMLAutoFind(filename, subfolderName string)
- func TOMLFile(names ...string)
- func UnmarshalKey(key string, target interface{}) error
- func Validate() error
- func YAMLAutoFind(filename, subfolderName string)
- func YAMLFile(names ...string)
- type Config
- func (c *Config) AddFirst(cc cfg.Configurer)
- func (c *Config) AddLast(cc cfg.Configurer)
- func (c *Config) Alias(virtual, real string)
- func (c *Config) AutoFind(name, subfolderName string) error
- func (c *Config) CustomMap(src map[string]interface{})
- func (c *Config) EnableCustomFlags(f *goflag.FlagSet)
- func (c *Config) EnableCustomPFlags(f *gopflag.FlagSet)
- func (c *Config) EnableFlags()
- func (c *Config) EnablePFlags()
- func (c *Config) EnablePlaceholdersInFile()
- func (c *Config) EnableValidation()
- func (c *Config) Has(key string) bool
- func (c *Config) INIAutoFind(filename, subfolderName string)
- func (c *Config) INIFile(names ...string)
- func (c *Config) JSONAutoFind(filename, subfolderName string)
- func (c *Config) JSONFile(names ...string)
- func (c *Config) KeyFunc(key string) func(interface{}) error
- func (c *Config) MustValidate()
- func (c *Config) TOMLAutoFind(filename, subfolderName string)
- func (c *Config) TOMLFile(names ...string)
- func (c *Config) UnmarshalKey(key string, target interface{}) error
- func (c *Config) Validate() error
- func (c *Config) YAMLAutoFind(filename, subfolderName string)
- func (c *Config) YAMLFile(names ...string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddFirst ¶
func AddFirst(cc cfg.Configurer)
AddFirst registers configuration source and adds it to the beginning of configuration sources list, setting min priority
func AddLast ¶
func AddLast(cc cfg.Configurer)
AddLast registers configuration source and adds it to the end of configuration sources list, setting max priority
func AutoFind ¶
AutoFind registers configuration source read from required file File will searched in current folder, then in home folder and then in /etc/ File type will be determined from its extension
func CustomMap ¶
func CustomMap(src map[string]interface{})
CustomMap methods registers custom configuration source from provided map
func EnableCustomFlags ¶
EnableCustomFlags registers configuration source from provided FlagSet
func EnableCustomPFlags ¶
EnableCustomPFlags registers configuration source from provided improved PFlagSet
func EnablePlaceholdersInFile ¶
func EnablePlaceholdersInFile()
EnablePlaceholdersInFile enables placeholders parsing
func INIAutoFind ¶
func INIAutoFind(filename, subfolderName string)
INIAutoFind registers configuration source read from required file File will searched in current folder, then in home folder and then in /etc/
func INIFile ¶
func INIFile(names ...string)
INIFile registers configuration source read from JSON file
func JSONAutoFind ¶
func JSONAutoFind(filename, subfolderName string)
JSONAutoFind registers configuration source read from required file File will searched in current folder, then in home folder and then in /etc/
func JSONFile ¶
func JSONFile(names ...string)
JSONFile registers configuration source read from JSON file
func OrDefault ¶
func OrDefault(c cfg.Configurer) cfg.Configurer
OrDefault methods checks argument and returns default global configurer if provided one is null
func TOMLAutoFind ¶
func TOMLAutoFind(filename, subfolderName string)
TOMLAutoFind registers configuration source read from required file File will searched in current folder, then in home folder and then in /etc/
func TOMLFile ¶
func TOMLFile(names ...string)
TOMLFile registers configuration source read from TOML file
func UnmarshalKey ¶
UnmarshalKey writes configuration value from string key into interface target
func YAMLAutoFind ¶
func YAMLAutoFind(filename, subfolderName string)
YAMLAutoFind registers configuration source read from required file File will searched in current folder, then in home folder and then in /etc/
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config is helper configuration structure
func (*Config) AddFirst ¶
func (c *Config) AddFirst(cc cfg.Configurer)
AddFirst registers configuration source and adds it to the beginning of configuration sources list, setting min priority
func (*Config) AddLast ¶
func (c *Config) AddLast(cc cfg.Configurer)
AddLast registers configuration source and adds it to the end of configuration sources list, setting max priority
func (*Config) AutoFind ¶
AutoFind registers configuration source read from required file File will searched in current folder, then in home folder and then in /etc/ File type will be determined from its extension
func (*Config) CustomMap ¶
CustomMap methods registers custom configuration source from provided map
func (*Config) EnableCustomFlags ¶
EnableCustomFlags registers configuration source from provided FlagSet
func (*Config) EnableCustomPFlags ¶
EnableCustomPFlags registers configuration source from provided improved PFlagSet
func (*Config) EnableFlags ¶
func (c *Config) EnableFlags()
EnableFlags enables standard library flags reading
func (*Config) EnablePFlags ¶
func (c *Config) EnablePFlags()
EnablePFlags enables improved flags reading
func (*Config) EnablePlaceholdersInFile ¶
func (c *Config) EnablePlaceholdersInFile()
EnablePlaceholdersInFile enables placeholders parsing
func (*Config) EnableValidation ¶
func (c *Config) EnableValidation()
EnableValidation enables config values validation
func (*Config) INIAutoFind ¶
INIAutoFind registers configuration source read from required file File will searched in current folder, then in home folder and then in /etc/
func (*Config) JSONAutoFind ¶
JSONAutoFind registers configuration source read from required file File will searched in current folder, then in home folder and then in /etc/
func (*Config) MustValidate ¶
func (c *Config) MustValidate()
MustValidate validates config and panics on error
func (*Config) TOMLAutoFind ¶
TOMLAutoFind registers configuration source read from required file File will searched in current folder, then in home folder and then in /etc/
func (*Config) UnmarshalKey ¶
UnmarshalKey writes configuration value from string key into interface target
func (*Config) YAMLAutoFind ¶
YAMLAutoFind registers configuration source read from required file File will searched in current folder, then in home folder and then in /etc/