Documentation ¶
Overview ¶
* Apollo配置初始化、监听配置变动、获取配置
Index ¶
- func GetBoolValue(key string, defaultValue bool) bool
- func GetFloatValue(key string, defaultV float64) float64
- func GetIntValue(key string, defaultValue int) int
- func GetStringValue(key, defaultValue string) string
- func Init(conf Conf) error
- func ListenChangeEvent() <-chan *agollo.ChangeEvent
- type Conf
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBoolValue ¶
GetBoolValue get config as bool
func GetFloatValue ¶
GetFloatValue get config as float
func GetStringValue ¶
GetStringValue get config as string
func ListenChangeEvent ¶
func ListenChangeEvent() <-chan *agollo.ChangeEvent
ListenApolloChangeEvent listen apollo config change event
Types ¶
type Conf ¶
type Conf struct { // application id AppId string `json:"appId"` // apollo cluster Cluster string `json:"cluster"` // apollo application Namespace string `json:"namespaceName"` // server address ex:127.0.0.1:8080 Ip string `json:"ip"` // apolloConfig.json path BackupConfigPath string `json:"backup_config_path"` }
Conf apollo config
Click to show internal directories.
Click to hide internal directories.