Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetConfigFile ¶
func SetConfigFile(file string)
Types ¶
type I ¶
type I interface { SetDefault(key string, value string) //设置默认值,最低优先级 Set(key string, value interface{}) //设置配置 原有将覆盖 BindEnv(key string, envName string) //绑定环境变量 GetBool(key string) bool // 获取 bool GetFloat64(key string) float64 // 获取 Float64 GetInt(key string) int // 获取Int GetIntSlice(key string) []int // 获取 []int GetString(key string) string // 获取 string GetStringMap(key string) map[string]interface{} // 获取 map[string]interface{} GetStringMapString(key string) map[string]string // 获取 map[string]string GetStringSlice(key string) []string // 获取 []string IsSet(key string) bool // 判断配置是否存在 AllSettings() map[string]interface{} //获取全部配置文件 //获取配置信息 可以通过Struct和字符串获取 备注:具体的Struct 写在configStruct.go Get(rawVal interface{}, key ...string) (err error) }
Click to show internal directories.
Click to hide internal directories.