Documentation ¶
Index ¶
- Constants
- type Apollo
- type Client
- func (c *Client) Close() error
- func (c *Client) Get(namespace, key string) string
- func (c *Client) GetCacheConfig(namespace string) error
- func (c *Client) GetDefault(key string) string
- func (c *Client) GetNoCacheConfig(namespace string) error
- func (c *Client) UpdateConfig(appId, clusterName string) error
- type Config
- type NoChangeError
- type NotificationInfo
- type NotificationMap
- type NotificationSlice
- type SpecialConfig
Constants ¶
View Source
const ( GetConfigUrl = "http://%s/configfiles/json/%s/%s/%s" NoCacheUrl = "http://%s/configs/%s/%s/%s" NotificationsUrl = "http://%s/notifications/v2?appId=%s&cluster=%s" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Addr string AppId string `json:"appId"` Cluster string `json:"cluster"` IP string `json:"ip"` SpecialConfig SpecialConfig //一个应用的appId和集群应该是启动时确定的,但却可以有多个namespace Configurations map[string]*Apollo Notifications NotificationMap // contains filtered or unexported fields }
func New ¶
func New(addr, appId, cluster, ip string, namespaces []string, initConfig SpecialConfig) *Client
func (*Client) GetCacheConfig ¶
func (*Client) GetDefault ¶
func (*Client) GetNoCacheConfig ¶
func (*Client) UpdateConfig ¶
type Config ¶
type NoChangeError ¶
type NoChangeError struct{}
func (*NoChangeError) Error ¶
func (e *NoChangeError) Error() string
type NotificationInfo ¶
type NotificationMap ¶
func (NotificationMap) ToSlice ¶
func (nm NotificationMap) ToSlice() NotificationSlice
func (NotificationMap) Update ¶
func (nm NotificationMap) Update(ns []NotificationInfo)
type NotificationSlice ¶
type NotificationSlice []NotificationInfo
func (*NotificationSlice) Add ¶
func (ns *NotificationSlice) Add(nameSpace string)
func (NotificationSlice) ToMap ¶
func (ns NotificationSlice) ToMap() NotificationMap
type SpecialConfig ¶
Click to show internal directories.
Click to hide internal directories.