Documentation ¶
Index ¶
- Constants
- Variables
- func GetConfigs(actionData []byte) (map[string]interface{}, error)
- func GetDefaultHeaders(tenantName string) http.Header
- type Client
- func (c *Client) AddConfig(data *CreateConfigAPI) (map[string]interface{}, error)
- func (c *Client) DeleteConfig(data *DeleteConfigAPI) (map[string]interface{}, error)
- func (c *Client) Do(method string, data interface{}) (map[string]interface{}, error)
- func (c *Client) Flatten(dimensionInfo string) (map[string]interface{}, error)
- func (c *Client) GetConfigServer() ([]string, error)
- func (c *Client) HTTPDo(method string, rawURL string, headers http.Header, body []byte) (resp *http.Response, err error)
- func (c *Client) PullGroupByDimension(dimensionInfo string) (map[string]map[string]interface{}, error)
- func (c *Client) Shuffle() error
- func (c *Client) Watch(f func(map[string]interface{}), errHandler func(err error)) error
- type CreateConfigAPI
- type DeleteConfigAPI
- type Event
- type Options
Constants ¶
View Source
const ( //HeaderContentType is a variable of type string. HeaderContentType = "Content-Type" //HeaderUserAgent is a variable of type string. HeaderUserAgent = "User-Agent" //HeaderEnvironment specifies the environment of a service. HeaderEnvironment = "X-Environment" )
Variables ¶
View Source
var ( //HeaderTenantName is a variable of type string. HeaderTenantName = "X-Tenant-Name" //ConfigPath is a variable of type string. ConfigPath = "" //ConfigRefreshPath is a variable of type string. ConfigRefreshPath = "" )
Functions ¶
func GetConfigs ¶
GetConfigs get KV from a event.
func GetDefaultHeaders ¶
GetDefaultHeaders gets default headers.
Types ¶
type Client ¶
Client is a struct.
func (*Client) AddConfig ¶
func (c *Client) AddConfig(data *CreateConfigAPI) (map[string]interface{}, error)
AddConfig post new config.
func (*Client) DeleteConfig ¶
func (c *Client) DeleteConfig(data *DeleteConfigAPI) (map[string]interface{}, error)
DeleteConfig delete configs.
func (*Client) Flatten ¶
Flatten pulls all the configuration from config center and merge kv in different dimension.
func (*Client) GetConfigServer ¶
GetConfigServer is a method used for getting server configuration.
func (*Client) HTTPDo ¶
func (c *Client) HTTPDo(method string, rawURL string, headers http.Header, body []byte) (resp *http.Response, err error)
HTTPDo Use http-client package for rest communication.
type CreateConfigAPI ¶
type CreateConfigAPI struct { DimensionInfo string `json:"dimensionsInfo"` Items map[string]interface{} `json:"items"` }
CreateConfigAPI for new config.
type DeleteConfigAPI ¶
type DeleteConfigAPI struct { DimensionInfo string `json:"dimensionsInfo"` Keys []string `json:"keys"` }
DeleteConfigAPI for deleting.
Click to show internal directories.
Click to hide internal directories.