Documentation ¶
Index ¶
- Constants
- type Client
- func (c *Client) Close() error
- func (c *Client) Get(namespace, key string) string
- func (c *Client) GetCacheConfig(namespace string) (*Configuration, error)
- func (c *Client) GetDefault(key string) string
- func (c *Client) GetDefaultConfig() (*Configuration, error)
- func (c *Client) GetNoCacheConfig(namespace string) (*Configuration, error)
- func (c *Client) UpdateConfig(appId, clusterName string) error
- type Config
- type Configuration
- type NoChangeError
- type NotificationInfo
- type NotificationMap
- type NotificationSlice
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"` InitNamespace string `json:"initNamespace"` //一个应用的appId和集群应该是启动时确定的,但却可以有多个namespace Configurations map[string]*Configuration Notifications NotificationMap // contains filtered or unexported fields }
func (*Client) GetCacheConfig ¶
func (c *Client) GetCacheConfig(namespace string) (*Configuration, error)
func (*Client) GetDefault ¶
func (*Client) GetDefaultConfig ¶
func (c *Client) GetDefaultConfig() (*Configuration, error)
func (*Client) GetNoCacheConfig ¶
func (c *Client) GetNoCacheConfig(namespace string) (*Configuration, error)
func (*Client) UpdateConfig ¶
type Config ¶
type Configuration ¶
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
Click to show internal directories.
Click to hide internal directories.