Documentation ¶
Index ¶
- func AllSettings() map[string]interface{}
- func BindEnvConfig(prefix string, key string) error
- func BindPflagConfig(pflagKey string, cmdFlag *pflag.Flag)
- func Get(key string) interface{}
- func GetBool(key string) bool
- func GetDuration(key string) time.Duration
- func GetFloat64(key string) float64
- func GetInstance() *viper.Viper
- func GetInt(key string) int
- func GetIntSlice(key string) []int
- func GetString(key string) string
- func GetStringMap(key string) map[string]interface{}
- func GetStringMapString(key string) map[string]string
- func GetStringSlice(key string) []string
- func GetTime(key string) time.Time
- func InitConfigs() error
- func IsSet(key string) bool
- func LoadConfigs(configName string, configType string, configPath string) error
- func SafeWriteConfig()
- func SafeWriteConfigAs(filePath string)
- func Set(key string, val interface{})
- func SetDefault(key string, val interface{})
- func WriteConfig()
- func WriteConfigAs(filePath string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllSettings ¶
func AllSettings() map[string]interface{}
func GetDuration ¶
func GetFloat64 ¶
func GetIntSlice ¶
func GetStringMap ¶
func GetStringMapString ¶
func GetStringSlice ¶
func LoadConfigs ¶
加载配置文件 支持指定多个路径
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.