Documentation
¶
Index ¶
- Variables
- func GetAllKeys(namespace string) []string
- func GetNameSpaceContent(namespace, defaultValue string) string
- func GetReleaseKey(namespace string) string
- func GetStringValue(key, defaultValue string) string
- func GetStringValueWithNameSpace(namespace, key, defaultValue string) string
- func Start() error
- func StartWithConf(conf *Conf) error
- func StartWithConfFile(name string) error
- func Stop() error
- func SubscribeToNamespaces(namespaces ...string) error
- func WatchUpdate() <-chan *ChangeEvent
- type Change
- type ChangeEvent
- type ChangeType
- type Client
- func (c *Client) GetAllKeys(namespace string) []string
- func (c *Client) GetNameSpaceContent(namespace, defaultValue string) string
- func (c *Client) GetReleaseKey(namespace string) string
- func (c *Client) GetStringValue(key, defaultValue string) string
- func (c *Client) GetStringValueWithNameSpace(namespace, key, defaultValue string) string
- func (c *Client) Start() error
- func (c *Client) Stop() error
- func (c *Client) SubscribeToNamespaces(namespaces ...string) error
- func (c *Client) WatchUpdate() <-chan *ChangeEvent
- type Conf
Constants ¶
This section is empty.
Variables ¶
var ErrorStatusNotOK = errors.New("http resp code not ok")
Functions ¶
func GetAllKeys ¶
GetAllKeys return all config keys in given namespace
func GetNameSpaceContent ¶
GetNameSpaceContent get contents of namespace
func GetReleaseKey ¶
GetReleaseKey return release key for namespace
func GetStringValue ¶
GetStringValue from default namespace
func GetStringValueWithNameSpace ¶
GetStringValueWithNameSpace get value from given namespace
func StartWithConfFile ¶
StartWithConfFile run agollo with conf file
func SubscribeToNamespaces ¶
SubscribeToNamespaces fetch namespace config to local and subscribe to updates
Types ¶
type Change ¶
type Change struct { OldValue string NewValue string ChangeType ChangeType }
Change represent a single key change
type ChangeEvent ¶
ChangeEvent change event
type ChangeType ¶
type ChangeType int
ChangeType for a key
const ( // ADD a new value ADD ChangeType = iota // MODIFY a old value MODIFY // DELETE ... DELETE )
func (ChangeType) String ¶
func (c ChangeType) String() string
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client for apollo
func (*Client) GetAllKeys ¶
GetAllKeys return all config keys in given namespace
func (*Client) GetNameSpaceContent ¶
GetNameSpaceContent get contents of namespace
func (*Client) GetReleaseKey ¶
GetReleaseKey return release key for namespace
func (*Client) GetStringValue ¶
GetStringValue from default namespace
func (*Client) GetStringValueWithNameSpace ¶
GetStringValueWithNameSpace get value from given namespace
func (*Client) SubscribeToNamespaces ¶
SubscribeToNamespaces fetch namespace config to local and subscribe to updates
func (*Client) WatchUpdate ¶
func (c *Client) WatchUpdate() <-chan *ChangeEvent
WatchUpdate get all updates