xapollo_client

package
v0.0.0-...-9493ce7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 6, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

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 注册配置改变事件

func (*ApolloClient) Start

func (object *ApolloClient) Start()

Start 启动

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 配置改变通知

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL