Documentation
¶
Overview ¶
Package config 负责配置信息
Index ¶
- Variables
- func Add(name string, configFn ConfigFunc)
- func Env(envName string, defaultValue ...interface{}) interface{}
- func Get(path string, defaultValue ...interface{}) string
- func GetBool(path string, defaultValue ...interface{}) bool
- func GetFloat64(path string, defaultValue ...interface{}) float64
- func GetInt(path string, defaultValue ...interface{}) int
- func GetInt64(path string, defaultValue ...interface{}) int64
- func GetString(path string, defaultValue ...interface{}) string
- func GetStringMapString(path string) map[string]string
- func GetStringSlice(path string) []string
- func GetToPath(path string, defaultValue ...interface{}) string
- func GetUint(path string, defaultValue ...interface{}) uint
- func InitConfig()
- type ConfigFunc
- type ServiceDiscovery
Constants ¶
This section is empty.
Variables ¶
View Source
var ConfigFuncs map[string]ConfigFunc
ConfigFuncs 先加载到此数组,loadConfig 在动态生成配置信息
Functions ¶
func GetFloat64 ¶
GetFloat64 获取 float64 类型的配置信息
func GetStringMapString ¶
GetStringMapString 获取结构数据
func GetStringSlice ¶
Types ¶
type ServiceDiscovery ¶
type ServiceDiscovery struct {
// contains filtered or unexported fields
}
ServiceDiscovery 服务发现
func NewServiceDiscovery ¶
func NewServiceDiscovery(hosts []string, name, pwd string) *ServiceDiscovery
NewServiceDiscovery 新建发现服务
func (*ServiceDiscovery) Stop ¶
func (s *ServiceDiscovery) Stop()
func (*ServiceDiscovery) WatchService ¶
func (s *ServiceDiscovery) WatchService() error
WatchService 初始化服务列表和监视
Click to show internal directories.
Click to hide internal directories.