Documentation
¶
Index ¶
- Constants
- Variables
- type ARPPluginConfig
- 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 OutscalePublicIPPluginConfig
- type UpdateEndpointParams
- type WebhookPluginConfig
- type WebhookPluginStatusChangePayload
Constants ¶
View Source
const ( Activated = "ACTIVATED" Standby = "STANDBY" Failing = "FAILING" )
View Source
const ( PluginARP = "arp" PluginWebhook = "webhook" PluginOutscalePublicIP = "outscale_public_ip" )
View Source
const ( HeaderWebhookTimestamp = "X-Link-Webhook-Timestamp" HeaderWebhookSignature = "X-Link-Webhook-Signature" HeaderWebhookResourceID = "X-Link-Webhook-Resource-ID" )
Variables ¶
View Source
var ( ErrWebhookRequestNil = errors.New("webhook request is required") ErrWebhookSecretMissing = errors.New("webhook secret is required") ErrWebhookRequestBodyMissing = errors.New("webhook request body is required") ErrWebhookTimestampMissing = errors.New("missing X-Link-Webhook-Timestamp header") ErrWebhookSignatureMissing = errors.New("missing X-Link-Webhook-Signature header") ErrWebhookSignatureInvalid = errors.New("invalid X-Link-Webhook-Signature header") ErrWebhookSignatureMismatch = errors.New("webhook signature does not match") ErrWebhookPayloadInvalid = errors.New("invalid webhook payload") )
Functions ¶
This section is empty.
Types ¶
type ARPPluginConfig ¶ added in v3.3.0
type ARPPluginConfig struct {
IP string `json:"ip"`
}
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 OutscalePublicIPPluginConfig ¶ added in v3.3.0
type UpdateEndpointParams ¶
type UpdateEndpointParams struct {
HealthChecks []HealthCheck `json:"healthchecks"`
}
type WebhookPluginConfig ¶ added in v3.3.0
type WebhookPluginStatusChangePayload ¶ added in v3.3.0
type WebhookPluginStatusChangePayload struct {
EndpointID string `json:"endpoint_id"`
ResourceID string `json:"resource_id"`
Plugin string `json:"plugin"`
Status string `json:"status"`
}
func ParseAndValidateWebhook ¶ added in v3.3.0
func ParseAndValidateWebhook( ctx context.Context, req *http.Request, secret string, ) (WebhookPluginStatusChangePayload, error)
ParseAndValidateWebhook decodes the payload and validates the webhook signature. The request body is restored before returning so callers can read it again if needed.
Click to show internal directories.
Click to hide internal directories.