Documentation ¶
Index ¶
- func New(option ...*Option) (v *viper.Viper, err error)
- func SetConfigFile(filename string)
- func SetConfigName(name string)
- func SetConfigType(typ string)
- func SetEnvFileKey(val string)
- func SetEnvPrefix(prefix string)
- func SetSearchPath(paths []string)
- func SetWatchHandler(handler func(v *viper.Viper))
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetWatchHandler ¶
SetWatchHandler 设置默认配置变动后执行的操作
Types ¶
type Option ¶
type Option struct { // 提供者,file, content,etcd, consul, firestore Provider string `json:"provider" yaml:"provider"` Name string `json:"name" yaml:"name"` Type string `json:"type" yaml:"type"` File string `json:"file" yaml:"file"` SearchPath []string `json:"searchPath" yaml:"searchPath"` Env bool `json:"env" yaml:"env"` EnvPrefix string `json:"envPrefix" yaml:"envPrefix"` EndPoint string `json:"endPoint" yaml:"endPoint"` SecretKey string `json:"secretKey" yaml:"secretKey"` Watch bool `json:"watch" yaml:"watch"` IsRemote bool `json:"isRemote" yaml:"isRemote"` RemoteProvider string `json:"remoteProvider" yaml:"remoteProvider"` RemoteEndpoint string `json:"remote_endpoint" yaml:"remote_endpoint"` WatchHandler func(v *viper.Viper) }
Click to show internal directories.
Click to hide internal directories.