Documentation ¶
Overview ¶
v2 implements low-level primitives to interact with Exoscale API V2.
Index ¶
Constants ¶
const APIPrefix = "v2.alpha"
Variables ¶
This section is empty.
Functions ¶
func SetEndpointFromContext ¶
SetEndpointFromContext is an HTTP client request interceptor that overrides the "Host" header with information from a request endpoint optionally set in the context instance. If none is found, the request is left untouched.
func WithEndpoint ¶
func WithEndpoint(ctx context.Context, endpoint ReqEndpoint) context.Context
WithEndpoint returns an augmented context instance containing the Exoscale endpoint to send the request to.
Types ¶
type ReqEndpoint ¶
type ReqEndpoint struct {
// contains filtered or unexported fields
}
ReqEndpoint represents an Exoscale API request endpoint.
func NewReqEndpoint ¶
func NewReqEndpoint(env, zone string) ReqEndpoint
NewReqEndpoint returns a new Exoscale API request endpoint from an environment and zone.
func (*ReqEndpoint) Env ¶
func (r *ReqEndpoint) Env() string
Env returns the Exoscale API endpoint environment.
func (*ReqEndpoint) Host ¶
func (r *ReqEndpoint) Host() string
Host returns the Exoscale API endpoint host FQDN.
func (*ReqEndpoint) Zone ¶
func (r *ReqEndpoint) Zone() string
Zone returns the Exoscale API endpoint zone.
type SecurityProviderExoscale ¶
type SecurityProviderExoscale struct { // ReqExpire represents the request expiration duration. ReqExpire time.Duration // contains filtered or unexported fields }
SecurityProviderExoscale represents an Exoscale API V2 security provider.
func NewSecurityProviderExoscale ¶
func NewSecurityProviderExoscale(apiKey, apiSecret string) (*SecurityProviderExoscale, error)
NewSecurityProviderExoscaleV2 returns a new Exoscale API V2 security provider to sign API requests using the specified API key/secret.