Documentation ¶
Index ¶
- Variables
- func AddConfigPath(in string)
- func AddRemoteProvider(provider, endpoint, path string) error
- func AddSecureRemoteProvider(provider, endpoint, path, secretkeyring string) error
- func AllKeys() []string
- func AllSettings() map[string]interface{}
- func AutomaticEnv()
- func BindEnv(input ...string) error
- func BindFlagValue(key string, flag FlagValue) error
- func BindFlagValues(flags FlagValueSet) (err error)
- func BindPFlag(key string, flag *pflag.Flag) error
- func BindPFlags(flags *pflag.FlagSet) error
- func ConfigFileUsed() string
- 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 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 InConfig(key string) bool
- func IsSet(key string) bool
- func LoadConfig()
- func MergeConfig(in io.Reader) error
- func MergeInConfig() error
- func OnConfigChange(run func(in fsnotify.Event))
- func ReadConfig(in io.Reader) error
- func ReadInConfig() error
- func ReadRemoteConfig() error
- func RegisterAlias(alias string, key string)
- func SafeWriteConfig() error
- func SafeWriteConfigAs(filename string) error
- func Set(key string, value interface{})
- func SetConfigFile(in string)
- func SetConfigName(in string)
- func SetConfigType(in string)
- func SetDefault(key string, value interface{})
- func SetEnvKeyReplacer(r *strings.Replacer)
- func SetEnvPrefix(in string)
- func SetFs(fs afero.Fs)
- func SetTypeByDefaultValue(enable bool)
- func Unmarshal(rawVal interface{}) error
- func UnmarshalExact(rawVal interface{}) error
- func UnmarshalKey(key string, rawVal interface{}) error
- func WatchConfig()
- func WatchRemoteConfig() error
- func WatchRemoteConfigOnChannel() error
- func WriteConfig() error
- func WriteConfigAs(filename string) error
- type Config
- type FlagValue
- type FlagValueSet
Constants ¶
This section is empty.
Variables ¶
View Source
var Env config
Env 全局的配置变量
Functions ¶
func AddConfigPath ¶
func AddConfigPath(in string)
func AddRemoteProvider ¶
func AddSecureRemoteProvider ¶
func AllSettings ¶
func AllSettings() map[string]interface{}
func AutomaticEnv ¶
func AutomaticEnv()
func BindFlagValue ¶
func BindFlagValues ¶
func BindFlagValues(flags FlagValueSet) (err error)
func BindPFlags ¶
func ConfigFileUsed ¶
func ConfigFileUsed() string
func GetDuration ¶
func GetFloat64 ¶
func GetSizeInBytes ¶
func GetStringMap ¶
func GetStringMapString ¶
func GetStringMapStringSlice ¶
func GetStringSlice ¶
func MergeConfig ¶
func MergeInConfig ¶
func MergeInConfig() error
func OnConfigChange ¶
func ReadConfig ¶
func ReadInConfig ¶
func ReadInConfig() error
func ReadRemoteConfig ¶
func ReadRemoteConfig() error
func RegisterAlias ¶
func SafeWriteConfig ¶
func SafeWriteConfig() error
func SafeWriteConfigAs ¶
func SetConfigFile ¶
func SetConfigFile(in string)
func SetConfigName ¶
func SetConfigName(in string)
func SetConfigType ¶
func SetConfigType(in string)
func SetDefault ¶
func SetDefault(key string, value interface{})
func SetEnvKeyReplacer ¶
func SetEnvPrefix ¶
func SetEnvPrefix(in string)
func SetTypeByDefaultValue ¶
func SetTypeByDefaultValue(enable bool)
func UnmarshalExact ¶
func UnmarshalExact(rawVal interface{}) error
func UnmarshalKey ¶
func WatchConfig ¶
func WatchConfig()
func WatchRemoteConfig ¶
func WatchRemoteConfig() error
func WatchRemoteConfigOnChannel ¶
func WatchRemoteConfigOnChannel() error
func WriteConfig ¶
func WriteConfig() error
func WriteConfigAs ¶
Types ¶
type FlagValueSet ¶
type FlagValueSet = viper.FlagValueSet
Click to show internal directories.
Click to hide internal directories.