v2

package
v0.7.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	// Name of the Backend
	Name string `json:"name"`
	// IP addresses of the backend service
	IPs []string `json:"ips,omitempty"`
	// List of frontends connected to the backend
	Frontends []BackendFrontend `json:"frontends,omitempty"`
}

Define backend services and connect them to frontends

type BackendFrontend

type BackendFrontend struct {
	// Name of the frontend to be connected to the backend
	Name string `json:"name"`
}

type BackendProtocol

type BackendProtocol string
const (
	BackendProtocolTCP   BackendProtocol = "TCP"
	BackendProtocolPROXY BackendProtocol = "PROXY"
)

type Cluster

type Cluster struct {
	gs.GenericService
	gs.HasState

	Identifier       string                     `json:"identifier,omitempty" anxcloud:"identifier"`
	Name             string                     `json:"name,omitempty"`
	Implementation   LoadBalancerImplementation `json:"implementation,omitempty"`
	FrontendPrefixes *gs.PartialResourceList    `json:"frontend_prefixes,omitempty"`
	BackendPrefixes  *gs.PartialResourceList    `json:"backend_prefixes,omitempty"`
	Replicas         *int                       `json:"replicas,omitempty"`
}

Cluster holds the information of a load balancing cluster

func (*Cluster) EndpointURL

func (c *Cluster) EndpointURL(ctx context.Context) (*url.URL, error)

EndpointURL returns the common URL for operations on the Cluster resource

func (*Cluster) FilterAPIRequestBody

func (c *Cluster) FilterAPIRequestBody(ctx context.Context) (interface{}, error)

FilterAPIRequestBody adds the CommonRequestBody

func (*Cluster) GetIdentifier

func (o *Cluster) GetIdentifier(ctx context.Context) (string, error)

GetIdentifier returns the primary identifier of a Cluster object

type Definition

type Definition definition

func (*Definition) MarshalJSON

func (d *Definition) MarshalJSON() ([]byte, error)

func (*Definition) UnmarshalJSON

func (d *Definition) UnmarshalJSON(data []byte) error

type Frontend

type Frontend struct {
	// Name of the Frontend
	Name string `json:"name"`
	// Frontend service protocol
	Protocol FrontendProtocol `json:"protocol"`
	// Configure frontend - backend relation
	Backend FrontendBackend `json:"backend,omitempty"`
	// TCP specific frontend configuration
	TCP *FrontendTCP `json:"tcp,omitempty"`
}

Define ports and protocols exposed to the public side of the Load Balancer

type FrontendBackend

type FrontendBackend struct {
	// Backend service protocol
	Protocol BackendProtocol `json:"protocol"`
	// TCP specific backend configuration
	TCP *FrontendBackendTCP `json:"tcp,omitempty"`
}

Configure frontend - backend relation

type FrontendBackendTCP

type FrontendBackendTCP struct {
	Port uint16 `json:"port"`
}

TCP specific backend configuration

type FrontendProtocol

type FrontendProtocol string
const (
	FrontendProtocolTCP FrontendProtocol = "TCP"
)

type FrontendTCP

type FrontendTCP struct {
	// Port for the frontend to listen to
	Port uint16 `json:"port,omitempty"`
}

TCP specific frontend configuration

type LoadBalancer

type LoadBalancer struct {
	gs.GenericService
	gs.HasState

	Identifier      string                  `json:"identifier,omitempty" anxcloud:"identifier"`
	Name            string                  `json:"name,omitempty"`
	Generation      int                     `json:"generation,omitempty"`
	Cluster         *common.PartialResource `json:"cluster,omitempty" anxcloud:"filterable"`
	FrontendIPs     *gs.PartialResourceList `json:"frontend_ips,omitempty"`
	SSLCertificates *gs.PartialResourceList `json:"ssl_certificates,omitempty"`
	// Definition configures the load balancer's frontends and backends.
	// This field is currently unstable and requires an update of go-anxcloud
	// in the near future.
	Definition *Definition `json:"definition,omitempty"`
}

LoadBalancer holds the information of a load balancing configuration within a Cluster

func (*LoadBalancer) EndpointURL

func (lb *LoadBalancer) EndpointURL(ctx context.Context) (*url.URL, error)

EndpointURL returns the common URL for operations on LoadBalancer resource

func (*LoadBalancer) FilterAPIRequestBody

func (lb *LoadBalancer) FilterAPIRequestBody(ctx context.Context) (interface{}, error)

FilterAPIRequestBody adds the CommonRequestBody

func (*LoadBalancer) GetIdentifier

func (o *LoadBalancer) GetIdentifier(ctx context.Context) (string, error)

GetIdentifier returns the primary identifier of a LoadBalancer object

type LoadBalancerImplementation

type LoadBalancerImplementation string
const (
	LoadBalancerImplementationHAProxy LoadBalancerImplementation = "haproxy"
)

type Node

type Node struct {
	gs.GenericService
	gs.HasState

	Identifier string                  `json:"identifier,omitempty" anxcloud:"identifier"`
	Name       string                  `json:"name,omitempty"`
	Cluster    *common.PartialResource `json:"cluster,omitempty" anxcloud:"filterable"`
}

Node holds the information of a load balancing node within a Cluster

func (*Node) EndpointURL

func (n *Node) EndpointURL(ctx context.Context) (*url.URL, error)

EndpointURL returns the common URL for operations on the Node resource

func (*Node) FilterAPIRequestBody

func (n *Node) FilterAPIRequestBody(ctx context.Context) (interface{}, error)

FilterAPIRequestBody adds the CommonRequestBody

func (*Node) GetIdentifier

func (o *Node) GetIdentifier(ctx context.Context) (string, error)

GetIdentifier returns the primary identifier of a Node object

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL