Documentation ¶
Index ¶
- Variables
- func GetBool(key string, defaultVal bool) bool
- func GetBoolFlag(name string) bool
- func GetEnv(key string) string
- func GetInt(key string, defaultVal int) int
- func GetInt64(key string, defaultVal int64) int64
- func GetIntFlag(name string) int
- func GetSliceString(key string, defaultVal []string) []string
- func GetString(key string, defaultVal string) string
- func GetStringFlag(name string) string
- func NewFlagParam() *flagParam
- func ParseParams()
- func ReloadConfig()
- func SetBoolFlag(name string, value bool, usage string)
- func SetIntFlag(name string, value int, usage string)
- func SetStringFlag(name string, value string, usage string)
- func StartConfig()
- func StartConfigWithPath(configPath string)
- func StartEnvFile()
- func UnmarshalKey(key string, rawVal interface{}) error
Constants ¶
This section is empty.
Variables ¶
View Source
var Config = cfg.New("")
View Source
var ConfigDef = cfg.New("")
Functions ¶
func GetBoolFlag ¶ added in v0.1.6
func GetIntFlag ¶
func GetSliceString ¶ added in v0.2.5
GetSliceString 获取slice
func GetStringFlag ¶
func ParseParams ¶
func ParseParams()
func ReloadConfig ¶ added in v0.2.33
func ReloadConfig()
func SetBoolFlag ¶ added in v0.1.6
SetBoolFlag register a bool params
func SetIntFlag ¶
SetIntFlag register a int params
func SetStringFlag ¶
SetStringFlag register a string params
func StartConfigWithPath ¶ added in v0.2.33
func StartConfigWithPath(configPath string)
StartConfigWithPath 通过配置文件路径加载配置
func StartEnvFile ¶ added in v0.5.18
func StartEnvFile()
StartEnvFile load .env file if not exist skip it
func UnmarshalKey ¶ added in v0.4.0
UnmarshalKey 将配置绑定到结构体
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.