Help us shape the future of Go! Take the 2026 Go Developer Survey

apolloclient

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2020 License: Apache-2.0 Imports: 11 Imported by: 1

README

apolloClient

Apollo Go Client

GitHub Release License

feature

GetConfig(param *GetConfigParam) (ConfigData, error)
GetConfigCache(param *GetConfigParam) (ConfigData, error)
GetNotifications(param *GetNotificationsParam) (bool, []Notification, error)

// support set access_key for configService
signature(secret, uri string, timestamp time.Time) (string, error)

example

https://github.com/2345tech/apollo-agent

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigData

type ConfigData struct {
	AppID      string            `json:"appId"`          // 应用ID
	Cluster    string            `json:"cluster"`        // 集群名称
	Namespace  string            `json:"namespaceName"`  // 命名空间
	Configs    map[string]string `json:"configurations"` // 配置项列表
	ReleaseKey string            `json:"releaseKey"`     // 当前的releaseKey
}

ConfigService :Apollo分布式配置中心真正存储配置数据的服务,提供不带缓存和带缓存两种方式拉取配置

type ConfigService

type ConfigService interface {
	GetConfig(param *GetConfigParam) (ConfigData, error)
	GetConfigCache(param *GetConfigParam) (ConfigData, error)
	GetNotifications(param *GetNotificationsParam) (bool, []Notification, error)
}

ConfigService :Apollo分布式配置中心真正存储配置数据的服务,提供不带缓存和带缓存两种方式拉取配置

func NewConfigService

func NewConfigService(httpClient *http.Client, serverAddr string) (ConfigService, error)

type GetConfigParam

type GetConfigParam struct {
	AppID      string // 应用ID,必填
	Cluster    string // 集群名称,选填
	Namespace  string // 命名空间,必填
	Secret     string // 授权密钥,选填
	ReleaseKey string // 上一次的releaseKey,选填
	ClientIP   string // 应用部署机器IP,选填
}

ConfigService :Apollo分布式配置中心真正存储配置数据的服务,提供不带缓存和带缓存两种方式拉取配置

type GetNotificationsParam

type GetNotificationsParam struct {
	AppID         string         // 应用ID,必填
	Cluster       string         // 集群名称,必填
	Secret        string         // 授权密钥,必填
	Notifications []Notification // 通知列表,必填
}

ConfigService :Apollo分布式配置中心真正存储配置数据的服务,提供不带缓存和带缓存两种方式拉取配置

type Notification

type Notification struct {
	Namespace      string `json:"namespaceName"`  // 命名空间,必填
	NotificationID int64  `json:"notificationId"` // 通知ID,必填
}

ConfigService :Apollo分布式配置中心真正存储配置数据的服务,提供不带缓存和带缓存两种方式拉取配置

Jump to

Keyboard shortcuts

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