Documentation ¶
Index ¶
- Variables
- func GetAppInfoByApollo(hostUrl string, appName string) ([]byte, error)
- func GetAppInfoFromApollo(hostUrl string, appName string, v interface{}) error
- func GetValueByKey(key string) (string, error)
- func InitApolloHandlers(a ApolloHandler)
- type ApolloHandler
- type ApolloResponse
- type ApolloTimer
Constants ¶
This section is empty.
Variables ¶
View Source
var ApolloHandlers []ApolloHandler
View Source
var ApolloResponseNil error = errors.New("*ApolloResponse is nil")
Functions ¶
func GetAppInfoByApollo ¶
从配置中心获取appInfo
func GetAppInfoFromApollo ¶
GetAppInfoFromApollo 调用方需要将v结构体提前定义好。如果不知道,就定义成map[string]interface{}
func GetValueByKey ¶
func InitApolloHandlers ¶
func InitApolloHandlers(a ApolloHandler)
InitApolloHandlers 监听者赶紧到这里来,按时触发一系列动作
Types ¶
type ApolloHandler ¶
ApolloHandler 当ApolloTimer 定时刷新的时候,主动触发此类操作
type ApolloResponse ¶
type ApolloResponse struct { AppID string `json:"appId"` Cluster string `json:"cluster"` NamespaceName string `json:"namespaceName"` Configurations map[string]string `json:"configurations"` ReleaseKey string `json:"releaseKey"` }
ApolloResponse 返回结构体
type ApolloTimer ¶
ApolloTimer apollo client 本地刷新器
func NewApolloListener ¶
func NewApolloListener(hostUrl string, appName string) ApolloTimer
Click to show internal directories.
Click to hide internal directories.