Documentation
¶
Index ¶
- func AllSettings() map[string]interface{}
- func Get(key string) interface{}
- func GetBool(key string) bool
- func GetFloat64(key string) float64
- func GetInt(key string) int
- func GetInt64(key string) int64
- func GetIntSlice(key string) []int
- func GetString(key string) string
- func GetStringMapString(key string) map[string]string
- func GetStringMapStringSlice(key string) map[string][]string
- func GetStringSlice(key string) []string
- func GetStringWithDefault(key, d string) string
- func GetTime(key string) time.Time
- func GetUint64(key string) uint64
- func GetWithDefault(key string, d interface{}) interface{}
- func IsSet(key string) bool
- func OnConfigChange(run func(in fsnotify.Event))
- func Set(key string, value interface{})
- func SetDefault(key string, value interface{})
- func UnmarshalKey(key string, rawVal interface{}) error
- func WatchConfig()
- func WriteConfigAs(filename string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllSettings ¶
func AllSettings() map[string]interface{}
AllSettings merges all settings and returns them as a map[string]interface{}.
func GetFloat64 ¶
GetFloat64 returns the value associated with the key as a float64.
func GetIntSlice ¶
GetIntSlice returns the value associated with the key as a slice of int values.
func GetStringMapString ¶
GetStringMapString returns the value associated with the key as a map of strings.
func GetStringMapStringSlice ¶
GetStringMapStringSlice returns the value associated with the key as a map to a slice of strings.
func GetStringSlice ¶
GetStringSlice returns the value associated with the key as a slice of strings.
func GetStringWithDefault ¶
GetStringWithDefault returns the value associated with the key as a string, if key not exist, return default value.
func GetWithDefault ¶
func GetWithDefault(key string, d interface{}) interface{}
GetWithDefault returns the value associated with the key, if key not exist, return default value.
func OnConfigChange ¶
OnConfigChange will call the input func when configuration changes
func Set ¶
func Set(key string, value interface{})
Set sets the value for the key in the override register. Set is case-insensitive for a key. Will be used instead of values obtained via flags, config file, ENV, default, or key/value store.
func SetDefault ¶
func SetDefault(key string, value interface{})
SetDefault sets the default value for this key. SetDefault is case-insensitive for a key.
func UnmarshalKey ¶
UnmarshalKey takes a single key and marshals it into a Struct
func WriteConfigAs ¶
WriteConfigAs writes current configuration to a given filename.
Types ¶
This section is empty.