Documentation ¶
Index ¶
- Variables
- func AddConfigPath(in string)
- func AddRemoteProvider(provider, endpoint, path string) error
- func AddSecureRemoteProvider(provider, endpoint, path, secret string) error
- func AllKeys() []string
- func AllSettings() map[string]interface{}
- func BindEnv(in ...string) error
- func BindFlagValue(key string, flag viper.FlagValue) error
- func BindFlagValues(flags viper.FlagValueSet) error
- func BindPFlag(key string, flag *pflag.Flag) error
- func BindPFlags(flags *pflag.FlagSet) error
- func Debug()
- 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 MergeConfig(in io.Reader) error
- func MergeConfigMap(cfg map[string]interface{}) error
- func MergeInConfig() error
- func ReadConfig(in io.Reader) error
- func ReadConfigFile(path string) error
- func ReadRemoteConfig() error
- func RegisterAlias(alias string, key string)
- func SafeWriteConfig() error
- func SafeWriteConfigAs(filename string) error
- func Set(key string, val interface{})
- func SetDefault(key string, val interface{})
- func Unmarshal(rawVal interface{}, opts ...viper.DecoderConfigOption) error
- func UnmarshalExact(rawVal interface{}, opts ...viper.DecoderConfigOption) error
- func UnmarshalKey(key string, rawVal interface{}, opts ...viper.DecoderConfigOption) error
- func WatchConfig()
- func WatchRemoteConfig() error
- func WatchRemoteConfigOnChannel() error
- func WriteConfig() error
- func WriteConfigFile(filename string) error
- type Viper
- func (v *Viper) AddConfigPath(in string)
- func (v *Viper) AddRemoteProvider(provider, endpoint, path string) error
- func (v *Viper) AddSecureRemoteProvider(provider, endpoint, path, secret string) error
- func (v *Viper) AllKeys() []string
- func (v *Viper) AllSettings() map[string]interface{}
- func (v *Viper) BindEnv(in ...string) error
- func (v *Viper) BindFlagValue(key string, flag viper.FlagValue) error
- func (v *Viper) BindFlagValues(flags viper.FlagValueSet) error
- func (v *Viper) BindPFlag(key string, flag *pflag.Flag) error
- func (v *Viper) BindPFlags(flags *pflag.FlagSet) error
- func (v *Viper) Debug()
- func (v *Viper) Get(key string) interface{}
- func (v *Viper) GetBool(key string) bool
- func (v *Viper) GetDuration(key string) time.Duration
- func (v *Viper) GetFloat64(key string) float64
- func (v *Viper) GetInt(key string) int
- func (v *Viper) GetInt32(key string) int32
- func (v *Viper) GetInt64(key string) int64
- func (v *Viper) GetIntSlice(key string) []int
- func (v *Viper) GetSizeInBytes(key string) uint
- func (v *Viper) GetString(key string) string
- func (v *Viper) GetStringMap(key string) map[string]interface{}
- func (v *Viper) GetStringMapInt(key string) map[string]int
- func (v *Viper) GetStringMapString(key string) map[string]string
- func (v *Viper) GetStringMapStringSlice(key string) map[string][]string
- func (v *Viper) GetStringSlice(key string) []string
- func (v *Viper) GetTime(key string) time.Time
- func (v *Viper) GetUint(key string) uint
- func (v *Viper) GetUint32(key string) uint32
- func (v *Viper) GetUint64(key string) uint64
- func (v *Viper) InConfig(key string) bool
- func (v *Viper) Instance() *viper.Viper
- func (v *Viper) IsSet(key string) bool
- func (v *Viper) MergeConfig(in io.Reader) error
- func (v *Viper) MergeConfigMap(cfg map[string]interface{}) error
- func (v *Viper) MergeInConfig() error
- func (v *Viper) ReadConfig(in io.Reader) error
- func (v *Viper) ReadConfigFile(path string) error
- func (v *Viper) ReadRemoteConfig() error
- func (v *Viper) RegisterAlias(alias string, key string)
- func (v *Viper) SafeWriteConfig() error
- func (v *Viper) SafeWriteConfigAs(filename string) error
- func (v *Viper) Set(key string, val interface{})
- func (v *Viper) SetConfigType(in string)
- func (v *Viper) SetDefault(key string, val interface{})
- func (v *Viper) Sub(key string) *Viper
- func (v *Viper) Unmarshal(rawVal interface{}, opts ...viper.DecoderConfigOption) error
- func (v *Viper) UnmarshalExact(rawVal interface{}, opts ...viper.DecoderConfigOption) error
- func (v *Viper) UnmarshalKey(key string, rawVal interface{}, opts ...viper.DecoderConfigOption) error
- func (v *Viper) WatchConfig()
- func (v *Viper) WatchRemoteConfig() error
- func (v *Viper) WatchRemoteConfigOnChannel() error
- func (v *Viper) WriteConfig() error
- func (v *Viper) WriteConfigFile(filename string) error
Constants ¶
This section is empty.
Variables ¶
var ( // SupportedExts describes the supported configuration formats // for the wrapper to avoid importing the spf13/viper package. // NOTE: This is a copy of spf13/viper.SupportedExts, // with the exception of the "ini" format, since its marshaller // does not have a thread-safe implementation. SupportedExts = []string{"dotenv", "env", "hcl", "json", "properties", "props", "prop", "toml", "yaml", "yml"} )
Functions ¶
func AddRemoteProvider ¶
AddRemoteProvider wraps viper's method.
func AddSecureRemoteProvider ¶
AddSecureRemoteProvider wraps viper's method.
func BindFlagValue ¶
BindFlagValue wraps viper's method.
func BindFlagValues ¶
func BindFlagValues(flags viper.FlagValueSet) error
BindFlagValues wraps viper's method.
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 GetIntSlice ¶
GetIntSlice returns the value associated with the key as a slice of int values.
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 MergeConfigMap ¶
MergeConfigMap wraps viper's method.
func RegisterAlias ¶
RegisterAlias wraps viper's method.
func SafeWriteConfigAs ¶
SafeWriteConfigAs wraps viper's method.
func Unmarshal ¶
func Unmarshal(rawVal interface{}, opts ...viper.DecoderConfigOption) error
Unmarshal wraps viper's method.
func UnmarshalExact ¶
func UnmarshalExact(rawVal interface{}, opts ...viper.DecoderConfigOption) error
UnmarshalExact wraps viper's method.
func UnmarshalKey ¶
func UnmarshalKey(key string, rawVal interface{}, opts ...viper.DecoderConfigOption) error
UnmarshalKey wraps viper's method.
func WatchRemoteConfigOnChannel ¶
func WatchRemoteConfigOnChannel() error
WatchRemoteConfigOnChannel wraps viper's method.
func WriteConfigFile ¶
WriteConfigFile wraps viper's method.
Types ¶
type Viper ¶
type Viper struct {
// contains filtered or unexported fields
}
Viper wraps spf13 viper configuration registry.
func (*Viper) AddConfigPath ¶
AddConfigPath wraps viper's method.
func (*Viper) AddRemoteProvider ¶
AddRemoteProvider wraps viper's method.
func (*Viper) AddSecureRemoteProvider ¶
AddSecureRemoteProvider wraps viper's method.
func (*Viper) AllSettings ¶
AllSettings wraps viper's method.
func (*Viper) BindFlagValue ¶
BindFlagValue wraps viper's method.
func (*Viper) BindFlagValues ¶
func (v *Viper) BindFlagValues(flags viper.FlagValueSet) error
BindFlagValues wraps viper's method.
func (*Viper) BindPFlags ¶
BindPFlags wraps viper's method.
func (*Viper) GetDuration ¶
GetDuration returns the value associated with the key as a duration.
func (*Viper) GetFloat64 ¶
GetFloat64 returns the value associated with the key as a float64.
func (*Viper) GetIntSlice ¶
GetIntSlice returns the value associated with the key as a slice of int values.
func (*Viper) GetSizeInBytes ¶
GetSizeInBytes wraps viper's method.
func (*Viper) GetStringMap ¶
GetStringMap returns the value associated with the key as a map of interfaces.
func (*Viper) GetStringMapInt ¶
GetStringMapString returns the value associated with the key as a map of strings.
func (*Viper) GetStringMapString ¶
GetStringMapString returns the value associated with the key as a map of strings.
func (*Viper) GetStringMapStringSlice ¶
GetStringMapStringSlice returns the value associated with the key as a map to a slice of strings.
func (*Viper) GetStringSlice ¶
GetStringSlice returns the value associated with the key as a slice of strings.
func (*Viper) GetUint32 ¶
GetUint32 returns the value associated with the key as an unsigned integer.
func (*Viper) GetUint64 ¶
GetUint64 returns the value associated with the key as an unsigned integer.
func (*Viper) MergeConfig ¶
MergeConfig wraps viper's method.
func (*Viper) MergeConfigMap ¶
MergeConfigMap wraps viper's method.
func (*Viper) MergeInConfig ¶
MergeInConfig wraps viper's method.
func (*Viper) ReadConfig ¶
ReadConfig wraps viper's method.
func (*Viper) ReadConfigFile ¶
ReadConfigFile wraps viper's method.
func (*Viper) ReadRemoteConfig ¶
ReadRemoteConfig wraps viper's method.
func (*Viper) RegisterAlias ¶
RegisterAlias wraps viper's method.
func (*Viper) SafeWriteConfig ¶
SafeWriteConfig wraps viper's method.
func (*Viper) SafeWriteConfigAs ¶
SafeWriteConfigAs wraps viper's method.
func (*Viper) SetConfigType ¶
SetConfigType sets the type of the configuration returned by the remote source, e.g. "json".
func (*Viper) SetDefault ¶
SetDefault wraps viper's method.
func (*Viper) Unmarshal ¶
func (v *Viper) Unmarshal(rawVal interface{}, opts ...viper.DecoderConfigOption) error
Unmarshal wraps viper's method.
func (*Viper) UnmarshalExact ¶
func (v *Viper) UnmarshalExact(rawVal interface{}, opts ...viper.DecoderConfigOption) error
UnmarshalExact wraps viper's method.
func (*Viper) UnmarshalKey ¶
func (v *Viper) UnmarshalKey(key string, rawVal interface{}, opts ...viper.DecoderConfigOption) error
UnmarshalKey wraps viper's method.
func (*Viper) WatchRemoteConfig ¶
WatchRemoteConfig wraps viper's method.
func (*Viper) WatchRemoteConfigOnChannel ¶
WatchRemoteConfigOnChannel wraps viper's method.
func (*Viper) WriteConfigFile ¶
WriteConfigFile wraps viper's method.