Documentation ¶
Index ¶
- func GetBatchQueryResponse(response *http.Response) (*api.BatchQueryResponse, error)
- func GetBatchWriteResponse(response *http.Response) (*api.BatchWriteResponse, error)
- func GetConfigBatchWriteResponse(response *http.Response) (*api.ConfigBatchWriteResponse, error)
- func GetConfigQueryResponse(response *http.Response) (*api.ConfigBatchQueryResponse, error)
- func GetConfigResponse(response *http.Response) (*api.ConfigResponse, error)
- func GetSimpleResponse(response *http.Response) (*api.Response, error)
- func JSONFromCircuitBreakers(circuitBreakers []*api.CircuitBreaker) (*bytes.Buffer, error)
- func JSONFromConfigFile(file *api.ConfigFile) (*bytes.Buffer, error)
- func JSONFromConfigFileRelease(file *api.ConfigFileRelease) (*bytes.Buffer, error)
- func JSONFromConfigGroup(group *api.ConfigFileGroup) (*bytes.Buffer, error)
- func JSONFromConfigReleases(configReleases []*api.ConfigRelease) (*bytes.Buffer, error)
- func JSONFromInstances(instances []*api.Instance) (*bytes.Buffer, error)
- func JSONFromNamespaces(namespaces []*api.Namespace) (*bytes.Buffer, error)
- func JSONFromRateLimits(rateLimits []*api.Rule) (*bytes.Buffer, error)
- func JSONFromServices(services []*api.Service) (*bytes.Buffer, error)
- func Login(username, password string) (*api.LoginResponse, error)
- type Client
- func (c *Client) CompleteURL(url string, params map[string][]interface{}) string
- func (c *Client) CreateCircuitBreakerVersions(circuitBreakers []*api.CircuitBreaker) (*api.BatchWriteResponse, error)
- func (c *Client) CreateCircuitBreakers(circuitBreakers []*api.CircuitBreaker) (*api.BatchWriteResponse, error)
- func (c *Client) CreateConfigFile(file *api.ConfigFile) (*api.ConfigResponse, error)
- func (c *Client) CreateConfigFileRelease(file *api.ConfigFileRelease) (*api.ConfigResponse, error)
- func (c *Client) CreateConfigGroup(group *api.ConfigFileGroup) (*api.ConfigResponse, error)
- func (c *Client) CreateInstances(instances []*api.Instance) (*api.BatchWriteResponse, error)
- func (c *Client) CreateNamespaces(namespaces []*api.Namespace) (*api.BatchWriteResponse, error)
- func (c *Client) CreateRateLimits(rateLimits []*api.Rule) (*api.BatchWriteResponse, error)
- func (c *Client) CreateServices(services []*api.Service) (*api.BatchWriteResponse, error)
- func (c *Client) DeleteCircuitBreakers(circuitBreakers []*api.CircuitBreaker) error
- func (c *Client) DeleteConfigFile(file *api.ConfigFile) (*api.ConfigResponse, error)
- func (c *Client) DeleteConfigGroup(group *api.ConfigFileGroup) (*api.ConfigResponse, error)
- func (c *Client) DeleteInstances(instances []*api.Instance) error
- func (c *Client) DeleteNamespaces(namespaces []*api.Namespace) error
- func (c *Client) DeleteNamespacesGetResp(namespaces []*api.Namespace) (*api.BatchWriteResponse, error)
- func (c *Client) DeleteRateLimits(rateLimits []*api.Rule) error
- func (c *Client) DeleteServices(services []*api.Service) error
- func (c *Client) EnableRateLimits(rateLimits []*api.Rule) error
- func (c *Client) GetCircuitBreaker(masterCircuitBreaker, circuitBreaker *api.CircuitBreaker) error
- func (c *Client) GetCircuitBreakerByService(service *api.Service, masterCircuitBreaker, circuitBreaker *api.CircuitBreaker) error
- func (c *Client) GetCircuitBreakerVersions(circuitBreaker *api.CircuitBreaker) error
- func (c *Client) GetCircuitBreakersRelease(circuitBreaker *api.CircuitBreaker, correctService *api.Service) error
- func (c *Client) GetInstances(instances []*api.Instance) error
- func (c *Client) GetNamespaces(namespaces []*api.Namespace) ([]*api.Namespace, error)
- func (c *Client) GetRateLimits(rateLimits []*api.Rule) error
- func (c *Client) GetServices(services []*api.Service) error
- func (c *Client) QueryConfigGroup(group *api.ConfigFileGroup, offset, limit int64) (*api.ConfigBatchQueryResponse, error)
- func (c *Client) ReleaseCircuitBreakers(configReleases []*api.ConfigRelease) error
- func (c *Client) SendRequest(method string, url string, body *bytes.Buffer) (*http.Response, error)
- func (c *Client) UnbindCircuitBreakers(configReleases []*api.ConfigRelease) error
- func (c *Client) UpdateCircuitBreakers(circuitBreakers []*api.CircuitBreaker) error
- func (c *Client) UpdateConfigFile(file *api.ConfigFile) (*api.ConfigResponse, error)
- func (c *Client) UpdateConfigGroup(group *api.ConfigFileGroup) (*api.ConfigResponse, error)
- func (c *Client) UpdateInstances(instances []*api.Instance) error
- func (c *Client) UpdateNamesapces(namespaces []*api.Namespace) error
- func (c *Client) UpdateRateLimits(rateLimits []*api.Rule) error
- func (c *Client) UpdateServices(services []*api.Service) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBatchQueryResponse ¶
func GetBatchQueryResponse(response *http.Response) (*api.BatchQueryResponse, error)
GetBatchQueryResponse 获取BatchQueryResponse
func GetBatchWriteResponse ¶
func GetBatchWriteResponse(response *http.Response) (*api.BatchWriteResponse, error)
GetBatchWriteResponse 获取BatchWriteResponse
func GetConfigBatchWriteResponse ¶
func GetConfigBatchWriteResponse(response *http.Response) (*api.ConfigBatchWriteResponse, error)
GetConfigBatchWriteResponse 获取BatchWriteResponse
func GetConfigQueryResponse ¶
func GetConfigQueryResponse(response *http.Response) (*api.ConfigBatchQueryResponse, error)
func GetConfigResponse ¶
func GetConfigResponse(response *http.Response) (*api.ConfigResponse, error)
func GetSimpleResponse ¶
GetSimpleResponse 获取SimpleResponse
func JSONFromCircuitBreakers ¶
func JSONFromCircuitBreakers(circuitBreakers []*api.CircuitBreaker) (*bytes.Buffer, error)
JSONFromCircuitBreakers marshals a slice of circuit breakers to JSON. 熔断规则数组转JSON
func JSONFromConfigFile ¶
func JSONFromConfigFile(file *api.ConfigFile) (*bytes.Buffer, error)
func JSONFromConfigFileRelease ¶
func JSONFromConfigFileRelease(file *api.ConfigFileRelease) (*bytes.Buffer, error)
func JSONFromConfigGroup ¶
func JSONFromConfigGroup(group *api.ConfigFileGroup) (*bytes.Buffer, error)
*
- @brief 实例数组转JSON
func JSONFromConfigReleases ¶
func JSONFromConfigReleases(configReleases []*api.ConfigRelease) (*bytes.Buffer, error)
JSONFromConfigReleases marshals a slice of config releases to JSON. 配置发布规则数组转JSON
func JSONFromNamespaces ¶
JSONFromNamespaces 将命名空间数组转换为JSON
Types ¶
type Client ¶
Client HTTP客户端
func (*Client) CompleteURL ¶
CompleteURL 生成GET请求的完整URL
func (*Client) CreateCircuitBreakerVersions ¶
func (c *Client) CreateCircuitBreakerVersions(circuitBreakers []*api.CircuitBreaker) (*api.BatchWriteResponse, error)
CreateCircuitBreakerVersions creates a slice of circuit breakers from JSON. 创建熔断规则版本
func (*Client) CreateCircuitBreakers ¶
func (c *Client) CreateCircuitBreakers(circuitBreakers []*api.CircuitBreaker) (*api.BatchWriteResponse, error)
CreateCircuitBreakers creates a slice of circuit breakers from JSON. 创建熔断规则
func (*Client) CreateConfigFile ¶
func (c *Client) CreateConfigFile(file *api.ConfigFile) (*api.ConfigResponse, error)
func (*Client) CreateConfigFileRelease ¶
func (c *Client) CreateConfigFileRelease(file *api.ConfigFileRelease) (*api.ConfigResponse, error)
func (*Client) CreateConfigGroup ¶
func (c *Client) CreateConfigGroup(group *api.ConfigFileGroup) (*api.ConfigResponse, error)
func (*Client) CreateNamespaces ¶
CreateNamespaces 创建命名空间
func (*Client) DeleteCircuitBreakers ¶
func (c *Client) DeleteCircuitBreakers(circuitBreakers []*api.CircuitBreaker) error
*
- @brief 删除熔断规则
func (*Client) DeleteConfigFile ¶
func (c *Client) DeleteConfigFile(file *api.ConfigFile) (*api.ConfigResponse, error)
func (*Client) DeleteConfigGroup ¶
func (c *Client) DeleteConfigGroup(group *api.ConfigFileGroup) (*api.ConfigResponse, error)
func (*Client) DeleteNamespaces ¶
DeleteNamespaces 删除命名空间
func (*Client) DeleteNamespacesGetResp ¶
func (c *Client) DeleteNamespacesGetResp(namespaces []*api.Namespace) (*api.BatchWriteResponse, error)
DeleteNamespaces 删除命名空间
func (*Client) EnableRateLimits ¶
EnableRateLimits 启用限流规则
func (*Client) GetCircuitBreaker ¶
func (c *Client) GetCircuitBreaker(masterCircuitBreaker, circuitBreaker *api.CircuitBreaker) error
*
- @brief 根据id和version查询熔断规则
func (*Client) GetCircuitBreakerByService ¶
func (c *Client) GetCircuitBreakerByService(service *api.Service, masterCircuitBreaker, circuitBreaker *api.CircuitBreaker) error
*
- @brief 查询服务绑定的熔断规则
func (*Client) GetCircuitBreakerVersions ¶
func (c *Client) GetCircuitBreakerVersions(circuitBreaker *api.CircuitBreaker) error
*
- @brief 查询熔断规则所有版本
func (*Client) GetCircuitBreakersRelease ¶
func (c *Client) GetCircuitBreakersRelease(circuitBreaker *api.CircuitBreaker, correctService *api.Service) error
*
- @brief 查询熔断规则的已发布规则及服务
func (*Client) GetNamespaces ¶
GetNamespaces 查询命名空间
func (*Client) QueryConfigGroup ¶
func (c *Client) QueryConfigGroup(group *api.ConfigFileGroup, offset, limit int64) (*api.ConfigBatchQueryResponse, error)
func (*Client) ReleaseCircuitBreakers ¶
func (c *Client) ReleaseCircuitBreakers(configReleases []*api.ConfigRelease) error
*
- @brief 发布熔断规则
func (*Client) SendRequest ¶
SendRequest 发送请求 HTTP Post/Put
func (*Client) UnbindCircuitBreakers ¶
func (c *Client) UnbindCircuitBreakers(configReleases []*api.ConfigRelease) error
*
- @brief 解绑熔断规则
func (*Client) UpdateCircuitBreakers ¶
func (c *Client) UpdateCircuitBreakers(circuitBreakers []*api.CircuitBreaker) error
UpdateCircuitBreakers 更新熔断规则
func (*Client) UpdateConfigFile ¶
func (c *Client) UpdateConfigFile(file *api.ConfigFile) (*api.ConfigResponse, error)
func (*Client) UpdateConfigGroup ¶
func (c *Client) UpdateConfigGroup(group *api.ConfigFileGroup) (*api.ConfigResponse, error)
func (*Client) UpdateNamesapces ¶
UpdateNamesapces 更新命名空间