Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetServiceIPs ¶
GetServiceIPs gets the IPs for a certain service specified by the uri.
Types ¶
type AccessKey ¶
type AccessKey sts.Credentials
AccessKey is an alias for sts.Credentials that used to sign the ACM APIs.
type ConfigOption ¶
type ConfigOption struct { DataID string Group string Tenant string // a.k.a. namespace MD5 string // for listen only }
ConfigOption specifies a certain config.
func ParseListenResponse ¶
func ParseListenResponse(resp []byte) (changed []ConfigOption)
ParseListenResponse gets the changed config(s).
func (ConfigOption) Join ¶
func (o ConfigOption) Join() string
Join returns a string form of the ConfigOption as `dataId^2group^2contentMD5^2tenant^1`.
type Service ¶
type Service struct { Host string Port string Path4IPs string Path4Config string // Cl is used for all requests except for listenConfig. Cl *http.Client // Listener is for listenConfig which performs long polling. Listener *http.Client }
Service is the config service.
func New ¶
New returns an ACM Service with default port & path setting. Get the endpoint from https://help.aliyun.com/document_detail/64129.html.
func (*Service) GetConfig ¶
func (s *Service) GetConfig(ak *AccessKey, opt ConfigOption) ([]byte, error)
GetConfig gets the specific config from ACM. https://help.aliyun.com/document_detail/64131.html
func (*Service) ListenConfig ¶
func (s *Service) ListenConfig(ak *AccessKey, opt ConfigOption) (resp []byte, err error)
ListenConfig listens for the changed config(s). https://help.aliyun.com/document_detail/64132.html