Documentation ¶
Index ¶
- type ApolloClient
- func (object *ApolloClient) Initialize(configServerAddr, appID, cluster, namespace string) *ApolloClient
- func (object *ApolloClient) PullConfig() (ccn *ConfigChangeNotification, err error)
- func (object *ApolloClient) RegisterConfigChangeNotification(callback func(ctx context.Context, param interface{}))
- func (object *ApolloClient) Start()
- type ConfigChangeNotification
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApolloClient ¶
type ApolloClient struct { ConfigServerAddr string // 配置服务器地址 AppID string // 应用id Cluster string // 集群 Namespace string // 命名空间 ReleaseKey string // 发行Key }
ApolloClient Apollo客户端
func GetApolloClientInstance ¶
func GetApolloClientInstance() *ApolloClient
GetApolloClientInstance 获取实例
func (*ApolloClient) Initialize ¶
func (object *ApolloClient) Initialize(configServerAddr, appID, cluster, namespace string) *ApolloClient
InitializeWithTimeout 初始化
func (*ApolloClient) PullConfig ¶
func (object *ApolloClient) PullConfig() (ccn *ConfigChangeNotification, err error)
PullConfig 拉取配置
func (*ApolloClient) RegisterConfigChangeNotification ¶
func (object *ApolloClient) RegisterConfigChangeNotification(callback func(ctx context.Context, param interface{}))
RegisterConfigChangeNotification 注册配置改变事件
type ConfigChangeNotification ¶
type ConfigChangeNotification struct { AppID string `json:"appId"` // 程序ID Cluster string `json:"cluster"` // 集群 NamespaceName string `json:"namespaceName"` // 命名空间 Configurations map[string]string `json:"configurations"` // 配置 ReleaseKey string `json:"releaseKey"` // 发行版本key }
ConfigChangeNotification 配置改变通知
Click to show internal directories.
Click to hide internal directories.