Documentation ¶
Overview ¶
Package client provides a client for interacting with the load balancer api
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( errors.New("client is unauthorized") // ErrPermissionDenied returned when the subject does not permissions to access the resource ErrPermissionDenied = errors.New("client does not have permissions") // ErrLBNotfound returned when the load balancer ID not found ErrLBNotfound = errors.New("loadbalancer ID not found") // ErrHTTPError returned when the http response is an error ErrHTTPError = errors.New("loadbalancer api http error") )ErrUnauthorized =
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client creates a new lb api client against a specific endpoint
func (*Client) GetLoadBalancer ¶
GetLoadBalancer returns a load balancer by id
type GQLClient ¶
type GQLClient interface {
Query(tx context.Context, q interface{}, variables map[string]interface{}, options ...graphql.Option) error
}
GQLClient is an interface for a graphql client
type GetLoadBalancer ¶
type GetLoadBalancer struct {
LoadBalancer LoadBalancer `graphql:"loadBalancer(id: $id)"`
}
GetLoadBalancer is a struct that represents the GetLoadBalancer GraphQL query
type LoadBalancer ¶
type LoadBalancer struct { ID string Name string Owner OwnerNode Location LocationNode IPAddresses []IPAddress `graphql:"IPAddresses" json:"IPAddresses"` Ports Ports }
LoadBalancer is a struct that represents the LoadBalancer GraphQL type
type LocationNode ¶
type LocationNode struct {
ID string
}
LocationNode is a struct that represents the LocationNode GraphQL type
type Option ¶
type Option func(*Client)
Option is a function that modifies a client
func WithHTTPClient ¶
WithHTTPClient functional option to set the http client
type OriginEdges ¶
type OriginEdges struct {
Node OriginNode
}
OriginEdges is a struct that represents the OriginEdges GraphQL type
type OriginNode ¶
OriginNode is a struct that represents the OriginNode GraphQL type
type Origins ¶
type Origins struct {
Edges []OriginEdges
}
Origins is a struct that represents the Origins GraphQL type
type OwnerNode ¶
type OwnerNode struct {
ID string
}
OwnerNode is a struct that represents the OwnerNode GraphQL type
type PortEdges ¶
type PortEdges struct {
Node PortNode
}
PortEdges is a struct that represents the PortEdges GraphQL type