Documentation ¶
Index ¶
- func HasConfigKey(m map[string]interface{}, key string) bool
- func InitViper(app string, path string, env string, config interface{}, pack bool) error
- func InitViperDefault(app string, path string, pack bool) error
- func ParseConfigValue(m map[string]interface{}, key string, opt interface{}, result interface{}) error
- func ReadRemoteConfig(address string, key string)
- type IConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasConfigKey ¶
HasConfigKey check config key,if exist return true, else return false
func InitViper ¶
InitViper init viper with app name and config name @app server bin name @path config dir @env dev/test/prod @config struct @pack in binary bin
func InitViperDefault ¶
InitViperDefault read default config
func ParseConfigValue ¶
func ParseConfigValue(m map[string]interface{}, key string, opt interface{}, result interface{}) error
ParseConfigValue read config from map,if not exist return default value,support string,int,bool
func ReadRemoteConfig ¶
ReadRemoteConfig get remote config from etcd
Types ¶
Click to show internal directories.
Click to hide internal directories.