http

package
v1.17.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2024 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBatchQueryResponse

func GetBatchQueryResponse(response *http.Response) (*apiservice.BatchQueryResponse, error)

GetBatchQueryResponse 获取BatchQueryResponse

func GetBatchWriteResponse

func GetBatchWriteResponse(response *http.Response) (*apiservice.BatchWriteResponse, error)

GetBatchWriteResponse 获取BatchWriteResponse

func GetConfigBatchWriteResponse

func GetConfigBatchWriteResponse(response *http.Response) (*apiconfig.ConfigBatchWriteResponse, error)

GetConfigBatchWriteResponse 获取BatchWriteResponse

func GetConfigEncryptAlgorithmResponse added in v1.17.2

func GetConfigEncryptAlgorithmResponse(response *http.Response) (*apiconfig.ConfigEncryptAlgorithmResponse, error)

func GetConfigImportResponse

func GetConfigImportResponse(response *http.Response) (*apiconfig.ConfigImportResponse, error)

GetConfigImportResponse 获取ConfigImportResponse

func GetConfigQueryResponse

func GetConfigQueryResponse(response *http.Response) (*apiconfig.ConfigBatchQueryResponse, error)

func GetConfigResponse

func GetConfigResponse(response *http.Response) (*apiconfig.ConfigResponse, error)

func GetSimpleResponse

func GetSimpleResponse(response *http.Response) (*apiservice.Response, error)

GetSimpleResponse 获取SimpleResponse

func JSONFromCircuitBreakers

func JSONFromCircuitBreakers(circuitBreakers []*apifault.CircuitBreaker) (*bytes.Buffer, error)

JSONFromCircuitBreakers marshals a slice of circuit breakers to JSON. 熔断规则数组转JSON

func JSONFromConfigFile

func JSONFromConfigFile(file *apiconfig.ConfigFile) (*bytes.Buffer, error)

func JSONFromConfigFileRelease

func JSONFromConfigFileRelease(file *apiconfig.ConfigFileRelease) (*bytes.Buffer, error)

func JSONFromConfigGroup

func JSONFromConfigGroup(group *apiconfig.ConfigFileGroup) (*bytes.Buffer, error)

*

  • @brief 实例数组转JSON

func JSONFromConfigReleases

func JSONFromConfigReleases(configReleases []*apiservice.ConfigRelease) (*bytes.Buffer, error)

JSONFromConfigReleases marshals a slice of config releases to JSON. 配置发布规则数组转JSON

func JSONFromInstances

func JSONFromInstances(instances []*apiservice.Instance) (*bytes.Buffer, error)

*

  • @brief 实例数组转JSON

func JSONFromNamespaces

func JSONFromNamespaces(namespaces []*apimodel.Namespace) (*bytes.Buffer, error)

JSONFromNamespaces 将命名空间数组转换为JSON

func JSONFromRateLimits

func JSONFromRateLimits(rateLimits []*apitraffic.Rule) (*bytes.Buffer, error)

*

  • @brief 限流规则数组转JSON

func JSONFromServices

func JSONFromServices(services []*apiservice.Service) (*bytes.Buffer, error)

*

  • @brief 服务数组转JSON

func Login

func Login(username, password string) (*apisecurity.LoginResponse, error)

Types

type Client

type Client struct {
	Address string
	Version string
	Worker  *http.Client
}

Client HTTP客户端

func NewClient

func NewClient(address, version string) *Client

NewClient 创建HTTP客户端

func (*Client) CompleteURL

func (c *Client) CompleteURL(url string, params map[string][]interface{}) string

CompleteURL 生成GET请求的完整URL

func (*Client) CreateCircuitBreakerVersions

func (c *Client) CreateCircuitBreakerVersions(circuitBreakers []*apifault.CircuitBreaker) (*apiservice.BatchWriteResponse, error)

CreateCircuitBreakerVersions creates a slice of circuit breakers from JSON. 创建熔断规则版本

func (*Client) CreateCircuitBreakers

func (c *Client) CreateCircuitBreakers(circuitBreakers []*apifault.CircuitBreaker) (*apiservice.BatchWriteResponse, error)

CreateCircuitBreakers creates a slice of circuit breakers from JSON. 创建熔断规则

func (*Client) CreateConfigFile

func (c *Client) CreateConfigFile(file *apiconfig.ConfigFile) (*apiconfig.ConfigResponse, error)

func (*Client) CreateConfigFileRelease

func (c *Client) CreateConfigFileRelease(file *apiconfig.ConfigFileRelease) (*apiconfig.ConfigResponse, error)

func (*Client) CreateConfigGroup

func (c *Client) CreateConfigGroup(group *apiconfig.ConfigFileGroup) (*apiconfig.ConfigResponse, error)

func (*Client) CreateInstances

func (c *Client) CreateInstances(instances []*apiservice.Instance) (*apiservice.BatchWriteResponse, error)

*

  • @brief 创建实例

func (*Client) CreateNamespaces

func (c *Client) CreateNamespaces(namespaces []*apimodel.Namespace) (*apiservice.BatchWriteResponse, error)

CreateNamespaces 创建命名空间

func (*Client) CreateRateLimits

func (c *Client) CreateRateLimits(rateLimits []*apitraffic.Rule) (*apiservice.BatchWriteResponse, error)

*

  • @brief 创建限流规则

func (*Client) CreateServices

func (c *Client) CreateServices(services []*apiservice.Service) (*apiservice.BatchWriteResponse, error)

*

  • @brief 创建服务

func (*Client) DeleteCircuitBreakers

func (c *Client) DeleteCircuitBreakers(circuitBreakers []*apifault.CircuitBreaker) error

*

  • @brief 删除熔断规则

func (*Client) DeleteConfigFile

func (c *Client) DeleteConfigFile(file *apiconfig.ConfigFile) (*apiconfig.ConfigResponse, error)

func (*Client) DeleteConfigGroup

func (c *Client) DeleteConfigGroup(group *apiconfig.ConfigFileGroup) (*apiconfig.ConfigResponse, error)

func (*Client) DeleteInstances

func (c *Client) DeleteInstances(instances []*apiservice.Instance) error

*

  • @brief 删除实例

func (*Client) DeleteNamespaces

func (c *Client) DeleteNamespaces(namespaces []*apimodel.Namespace) error

DeleteNamespaces 删除命名空间

func (*Client) DeleteNamespacesGetResp

func (c *Client) DeleteNamespacesGetResp(namespaces []*apimodel.Namespace) (*apiservice.BatchWriteResponse, error)

DeleteNamespaces 删除命名空间

func (*Client) DeleteRateLimits

func (c *Client) DeleteRateLimits(rateLimits []*apitraffic.Rule) error

*

  • @brief 删除限流规则

func (*Client) DeleteServices

func (c *Client) DeleteServices(services []*apiservice.Service) error

*

  • @brief 删除服务

func (*Client) EnableRateLimits

func (c *Client) EnableRateLimits(rateLimits []*apitraffic.Rule) error

EnableRateLimits 启用限流规则

func (*Client) ExportConfigFile

func (c *Client) ExportConfigFile(req *apiconfig.ConfigFileExportRequest) error

func (*Client) GetAllConfigEncryptAlgorithms added in v1.17.2

func (c *Client) GetAllConfigEncryptAlgorithms() (*apiconfig.ConfigEncryptAlgorithmResponse, error)

func (*Client) GetCircuitBreaker

func (c *Client) GetCircuitBreaker(masterCircuitBreaker, circuitBreaker *apifault.CircuitBreaker) error

*

  • @brief 根据id和version查询熔断规则

func (*Client) GetCircuitBreakerByService

func (c *Client) GetCircuitBreakerByService(service *apiservice.Service, masterCircuitBreaker,
	circuitBreaker *apifault.CircuitBreaker) error

*

  • @brief 查询服务绑定的熔断规则

func (*Client) GetCircuitBreakerVersions

func (c *Client) GetCircuitBreakerVersions(circuitBreaker *apifault.CircuitBreaker) error

*

  • @brief 查询熔断规则所有版本

func (*Client) GetCircuitBreakersRelease

func (c *Client) GetCircuitBreakersRelease(circuitBreaker *apifault.CircuitBreaker, correctService *apiservice.Service) error

*

  • @brief 查询熔断规则的已发布规则及服务

func (*Client) GetInstances

func (c *Client) GetInstances(instances []*apiservice.Instance) error

*

  • @brief 查询实例

func (*Client) GetNamespaces

func (c *Client) GetNamespaces(namespaces []*apimodel.Namespace) ([]*apimodel.Namespace, error)

GetNamespaces 查询命名空间

func (*Client) GetRateLimits

func (c *Client) GetRateLimits(rateLimits []*apitraffic.Rule) error

*

  • @brief 查询限流规则

func (*Client) GetServices

func (c *Client) GetServices(services []*apiservice.Service) error

*

  • @brief 查询服务

func (*Client) ImportConfigFile

func (c *Client) ImportConfigFile(namespace, group, conflictHandling string) (*apiconfig.ConfigImportResponse, error)

func (*Client) QueryConfigGroup

func (c *Client) QueryConfigGroup(group *apiconfig.ConfigFileGroup,
	offset, limit int64) (*apiconfig.ConfigBatchQueryResponse, error)

func (*Client) ReleaseCircuitBreakers

func (c *Client) ReleaseCircuitBreakers(configReleases []*apiservice.ConfigRelease) error

*

  • @brief 发布熔断规则

func (*Client) SendRequest

func (c *Client) SendRequest(method string, url string, body *bytes.Buffer) (*http.Response, error)

SendRequest 发送请求 HTTP Post/Put

func (*Client) UnbindCircuitBreakers

func (c *Client) UnbindCircuitBreakers(configReleases []*apiservice.ConfigRelease) error

*

  • @brief 解绑熔断规则

func (*Client) UpdateCircuitBreakers

func (c *Client) UpdateCircuitBreakers(circuitBreakers []*apifault.CircuitBreaker) error

UpdateCircuitBreakers 更新熔断规则

func (*Client) UpdateConfigFile

func (c *Client) UpdateConfigFile(file *apiconfig.ConfigFile) (*apiconfig.ConfigResponse, error)

func (*Client) UpdateConfigGroup

func (c *Client) UpdateConfigGroup(group *apiconfig.ConfigFileGroup) (*apiconfig.ConfigResponse, error)

func (*Client) UpdateInstances

func (c *Client) UpdateInstances(instances []*apiservice.Instance) error

*

  • @brief 更新实例

func (*Client) UpdateNamesapces

func (c *Client) UpdateNamesapces(namespaces []*apimodel.Namespace) error

UpdateNamesapces 更新命名空间

func (*Client) UpdateRateLimits

func (c *Client) UpdateRateLimits(rateLimits []*apitraffic.Rule) error

*

  • @brief 更新限流规则

func (*Client) UpdateServices

func (c *Client) UpdateServices(services []*apiservice.Service) error

*

  • @brief 更新服务

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL