Documentation
¶
Index ¶
- Constants
- type AddEndpointParams
- type Client
- type ClientOpt
- type Endpoint
- type EndpointGetResponse
- type EndpointListResponse
- type ErrNotFound
- type GetEndpointHostsResponse
- type HTTPClient
- func (c HTTPClient) AddEndpoint(ctx context.Context, params AddEndpointParams) (Endpoint, error)
- func (c HTTPClient) Failover(ctx context.Context, id string) error
- func (c HTTPClient) GetEndpoint(ctx context.Context, id string) (Endpoint, error)
- func (c HTTPClient) GetEndpointHosts(ctx context.Context, id string) ([]Host, error)
- func (c HTTPClient) ListEndpoints(ctx context.Context) ([]Endpoint, error)
- func (c HTTPClient) RemoveEndpoint(ctx context.Context, id string) error
- func (c HTTPClient) RotateEncryptionKey(ctx context.Context) error
- func (c HTTPClient) UpdateEndpoint(ctx context.Context, id string, params UpdateEndpointParams) (Endpoint, error)
- func (c HTTPClient) Version(ctx context.Context) (string, error)
- type HealthCheck
- type HealthCheckType
- type Host
- type UpdateEndpointParams
Constants ¶
View Source
const ( Activated = "ACTIVATED" Standby = "STANDBY" Failing = "FAILING" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddEndpointParams ¶
type AddEndpointParams struct {
HealthCheckInterval int `json:"healthcheck_interval"`
Checks []HealthCheck `json:"checks"`
Plugin string `json:"plugin"`
PluginConfig any `json:"plugin_config,omitempty"`
}
type Client ¶
type Client interface {
ListEndpoints(ctx context.Context) ([]Endpoint, error)
GetEndpoint(ctx context.Context, id string) (Endpoint, error)
GetEndpointHosts(ctx context.Context, id string) ([]Host, error)
AddEndpoint(ctx context.Context, params AddEndpointParams) (Endpoint, error)
UpdateEndpoint(ctx context.Context, id string, params UpdateEndpointParams) (Endpoint, error)
RemoveEndpoint(ctx context.Context, id string) error
Failover(ctx context.Context, id string) error
RotateEncryptionKey(ctx context.Context) error
Version(ctx context.Context) (string, error)
}
type ClientOpt ¶
type ClientOpt func(HTTPClient) HTTPClient
func WithPassword ¶
func WithTimeout ¶
func WithUserAgent ¶ added in v3.1.0
type EndpointGetResponse ¶
type EndpointGetResponse struct {
Endpoint Endpoint `json:"endpoint"`
}
type EndpointListResponse ¶
type EndpointListResponse struct {
Endpoints []Endpoint `json:"endpoints"`
}
type ErrNotFound ¶
type ErrNotFound struct {
// contains filtered or unexported fields
}
func (ErrNotFound) Error ¶
func (e ErrNotFound) Error() string
type GetEndpointHostsResponse ¶
type GetEndpointHostsResponse struct {
Hosts []Host `json:"hosts"`
}
type HTTPClient ¶
type HTTPClient struct {
// contains filtered or unexported fields
}
func NewHTTPClient ¶
func NewHTTPClient(opts ...ClientOpt) HTTPClient
func (HTTPClient) AddEndpoint ¶
func (c HTTPClient) AddEndpoint(ctx context.Context, params AddEndpointParams) (Endpoint, error)
func (HTTPClient) GetEndpoint ¶
func (HTTPClient) GetEndpointHosts ¶
func (HTTPClient) ListEndpoints ¶
func (c HTTPClient) ListEndpoints(ctx context.Context) ([]Endpoint, error)
func (HTTPClient) RemoveEndpoint ¶
func (c HTTPClient) RemoveEndpoint(ctx context.Context, id string) error
func (HTTPClient) RotateEncryptionKey ¶ added in v3.1.0
func (c HTTPClient) RotateEncryptionKey(ctx context.Context) error
func (HTTPClient) UpdateEndpoint ¶
func (c HTTPClient) UpdateEndpoint(ctx context.Context, id string, params UpdateEndpointParams) (Endpoint, error)
type HealthCheck ¶
type HealthCheck struct {
Type HealthCheckType `json:"type"`
Host string `json:"host"`
Port int `json:"port"`
}
type UpdateEndpointParams ¶
type UpdateEndpointParams struct {
HealthChecks []HealthCheck `json:"healthchecks"`
}
Click to show internal directories.
Click to hide internal directories.