Documentation
¶
Index ¶
- func BindOption(defaultValue interface{}, configKeys ...string) *base.Option
- func FileUsed() string
- func Get(key string) interface{}
- func GetBool(key string) bool
- func GetDuration(key string) time.Duration
- func GetFloat64(key string) float64
- func GetInt(key string) int
- func GetInt32(key string) int32
- func GetInt64(key string) int64
- func GetIntSlice(key string) []int
- func GetSizeInBytes(key string) uint
- func GetString(key string) string
- func GetStringMap(key string) map[string]interface{}
- func GetStringMapString(key string) map[string]string
- func GetStringMapStringSlice(key string) map[string][]string
- func GetStringSlice(key string) []string
- func GetTime(key string) time.Time
- func GetUint(key string) uint
- func GetUint32(key string) uint32
- func GetUint64(key string) uint64
- func InConfig(key string) bool
- func IsSet(key string) bool
- func NewConfig(args ...string) (config *base.Config, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindOption ¶
BindOption return an *Option bind with default *Config
func FileUsed ¶
func FileUsed() string
FileUsed returns the file used to populate the config registry.
func Get ¶
func Get(key string) interface{}
Get can retrieve any value given the key to use. Get is case-insensitive for a key. Get has the behavior of returning the value associated with the first place from where it is set. Viper will check in the following order: override, flag, env, config file, key/value store, default
Get returns an interface. For a specific value use one of the Get____ methods.
func GetBool ¶
GetBool returns the value associated with the key as a boolean.
func GetDuration ¶
GetDuration returns the value associated with the key as a duration.
func GetFloat64 ¶
GetFloat64 returns the value associated with the key as a float64.
func GetInt ¶
GetInt returns the value associated with the key as an integer.
func GetInt32 ¶
GetInt32 returns the value associated with the key as an integer.
func GetInt64 ¶
GetInt64 returns the value associated with the key as an integer.
func GetIntSlice ¶
GetIntSlice returns the value associated with the key as a slice of int values.
func GetSizeInBytes ¶
GetSizeInBytes returns the size of the value associated with the given key in bytes.
func GetString ¶
GetString returns the value associated with the key as a string.
func GetStringMap ¶
GetStringMap returns the value associated with the key as a map of interfaces.
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 GetTime ¶
GetTime returns the value associated with the key as time.
func GetUint ¶
GetUint returns the value associated with the key as an unsigned integer.
func GetUint32 ¶
GetUint32 returns the value associated with the key as an unsigned integer.
func GetUint64 ¶
GetUint64 returns the value associated with the key as an unsigned integer.
func InConfig ¶
InConfig checks to see if the given key (or an alias) is in the config file.
func IsSet ¶
IsSet checks to see if the key has been set in any of the data locations. IsSet is case-insensitive for a key.
Types ¶
This section is empty.