Documentation ¶
Index ¶
- func Add(name string, configuration map[string]interface{})
- func Env(envName string, defaultValue ...interface{}) interface{}
- func Get(path string, defaultValue ...interface{}) interface{}
- func GetBool(path string, defaultValue ...interface{}) bool
- func GetDuration(key string, defaultValue ...interface{}) time.Duration
- func GetFloat64(key string, defaultValue ...interface{}) float64
- func GetInt(path string, defaultValue ...interface{}) int
- func GetInt32(key string, defaultValue ...interface{}) int32
- func GetInt64(path string, defaultValue ...interface{}) int64
- func GetIntSlice(key string, defaultValue ...interface{}) []int
- func GetString(path string, defaultValue ...interface{}) string
- func GetStringMap(key string, defaultValue ...interface{}) map[string]interface{}
- func GetStringMapString(key string, defaultValue ...interface{}) map[string]string
- func GetStringMapStringSlice(key string, defaultValue ...interface{}) map[string][]string
- func GetStringSlice(key string, defaultValue ...interface{}) []string
- func GetTime(key string, defaultValue ...interface{}) time.Time
- func GetUint(path string, defaultValue ...interface{}) uint
- func GetUint16(key string, defaultValue ...interface{}) uint16
- func GetUint32(key string, defaultValue ...interface{}) uint32
- func GetUint64(key string, defaultValue ...interface{}) uint64
- func Reload() error
- func Set(name string, value interface{})
- func Setup(option ConfigOption) error
- type ConfigOption
- type StrMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Get ¶
func Get(path string, defaultValue ...interface{}) interface{}
Get 获取配置项,允许使用点式获取,如:app.name
func GetDuration ¶ added in v0.2.1
func GetFloat64 ¶ added in v0.2.1
func GetIntSlice ¶ added in v0.2.1
func GetStringMap ¶ added in v0.2.1
func GetStringMapString ¶ added in v0.2.1
func GetStringMapStringSlice ¶ added in v0.2.1
func GetStringSlice ¶ added in v0.2.1
func Setup ¶
func Setup(option ConfigOption) error
Types ¶
type ConfigOption ¶
Click to show internal directories.
Click to hide internal directories.