Documentation ¶
Overview ¶
Package client provides a client for interacting with the load balancer api
Index ¶
- Variables
- type Client
- type GQLClient
- type GetLoadBalancer
- type IPAddress
- type LoadBalancer
- type LocationNode
- type Metadata
- type MetadataStatusEdges
- type MetadataStatusNode
- type MetadataStatuses
- type Option
- type OriginEdges
- type OriginNode
- type Origins
- type OwnerNode
- type Pool
- type PortEdges
- type PortNode
- type Ports
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 IPAddress ¶
type IPAddress struct { ID string `graphql:"id" json:"id"` IP string `graphql:"ip" json:"ip"` Reserved bool `graphql:"reserved" json:"reserved"` }
IPAddress is a struct that represents the IPAddress GraphQL type
type LoadBalancer ¶
type LoadBalancer struct { ID string `graphql:"id" json:"id"` Name string `graphql:"name" json:"name"` Owner OwnerNode `graphql:"owner" json:"owner"` Location LocationNode `graphql:"location" json:"location"` IPAddresses []IPAddress `graphql:"IPAddresses" json:"IPAddresses"` Metadata Metadata `graphql:"metadata" json:"metadata"` Ports Ports `graphql:"ports" json:"ports"` }
LoadBalancer is a struct that represents the LoadBalancer GraphQL type
type LocationNode ¶
type LocationNode struct {
ID string `graphql:"id" json:"id"`
}
LocationNode is a struct that represents the LocationNode GraphQL type
type Metadata ¶ added in v0.0.33
type Metadata struct { ID string `graphql:"id" json:"id"` NodeID string `graphql:"nodeID" json:"nodeID"` Statuses MetadataStatuses `graphql:"statuses" json:"statuses"` }
Metadata is a struct that represents the metadata GraphQL type
type MetadataStatusEdges ¶ added in v0.0.33
type MetadataStatusEdges struct {
Node MetadataStatusNode `graphql:"node" json:"node"`
}
MetadataStatusEdges is a struct that represents the Metadata status edges GraphQL type
type MetadataStatusNode ¶ added in v0.0.33
type MetadataStatusNode struct { ID string `graphql:"id" json:"id"` Data json.RawMessage `graphql:"data"` Source string `graphql:"source" json:"source"` StatusNamespaceID string `graphql:"statusNamespaceID" json:"statusNamespaceID"` }
MetadataStatusNode is a struct that represents the Metadata status node GraphQL type
type MetadataStatuses ¶ added in v0.0.33
type MetadataStatuses struct {
Edges []MetadataStatusEdges `graphql:"edges" json:"edges"`
}
MetadataStatuses is a struct that represents the Metadata statuses 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 `graphql:"node" json:"node"`
}
OriginEdges is a struct that represents the OriginEdges GraphQL type
type OriginNode ¶
type OriginNode struct { ID string `graphql:"id" json:"id"` Name string `graphql:"name" json:"name"` Target string `graphql:"target" json:"target"` PortNumber int64 `graphql:"portNumber" json:"portNumber"` Weight int64 `graphql:"weight" json:"weight"` Active bool `graphql:"active" json:"active"` }
OriginNode is a struct that represents the OriginNode GraphQL type
type Origins ¶
type Origins struct {
Edges []OriginEdges `graphql:"edges" json:"edges"`
}
Origins is a struct that represents the Origins GraphQL type
type OwnerNode ¶
type OwnerNode struct {
ID string `graphql:"id" json:"id"`
}
OwnerNode is a struct that represents the OwnerNode GraphQL type
type Pool ¶
type Pool struct { ID string `graphql:"id"` Name string `graphql:"name" json:"name"` Protocol string `graphql:"protocol" json:"protocol"` Origins Origins `graphql:"origins" json:"origins"` }
Pool is a struct that represents the Pool GraphQL type
type PortEdges ¶
type PortEdges struct {
Node PortNode `graphql:"node" json:"node"`
}
PortEdges is a struct that represents the PortEdges GraphQL type