Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommonFolders ¶
CommonFolders returns list of common folder for configuration location including current folder, home folder and etc
func CommonFoldersWithSubfolder ¶
CommonFoldersWithSubfolder returns list of common folder for configuration location including current folder, home folder and etc
func PlaceholdersReader ¶
func PlaceholdersReader(read func(string) ([]byte, error), configurer cfg.Configurer) func(string) ([]byte, error)
PlaceholdersReader return file reader function, that reads file from filesystem and replaces all placeholders in it using previously loaded configs Ordering matters
Types ¶
type Configurer ¶
type Configurer struct {
// contains filtered or unexported fields
}
Configurer is container for file-based configuration
func New ¶
func New(fileNames []string, read func(string) ([]byte, error), build func([]byte) (cfg.Configurer, error)) *Configurer
New creates file-based configuration source
func (*Configurer) Has ¶
func (c *Configurer) Has(key string) bool
Has returns true if configurer has requested field
func (*Configurer) KeyFunc ¶
func (c *Configurer) KeyFunc(key string) func(interface{}) error
KeyFunc return Unmarshaling function for requested key
func (*Configurer) UnmarshalKey ¶
func (c *Configurer) UnmarshalKey(key string, target interface{}) error
UnmarshalKey writes configuration value from string key into interface target