emlb

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package emlb manages authentication to the Equinix Metal Load Balancer service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EMLB

type EMLB struct {
	TokenExchanger *TokenExchanger
	// contains filtered or unexported fields
}

EMLB is a client object for talking to the Equinix Metal Load Balancer API.

func NewEMLB

func NewEMLB(metalAPIKey, projectID, metro string) *EMLB

NewEMLB creates a new Equinix Metal Load Balancer API client object.

func (*EMLB) DeleteClusterLoadBalancer

func (e *EMLB) DeleteClusterLoadBalancer(ctx context.Context, clusterScope *scope.ClusterScope) error

DeleteClusterLoadBalancer deletes the Equinix Metal Load Balancer associated with a given ClusterScope.

func (*EMLB) DeleteLoadBalancer

func (e *EMLB) DeleteLoadBalancer(ctx context.Context, lbID string) (*http.Response, error)

DeleteLoadBalancer deletes an Equinix Metal Load Balancer given an ID.

func (*EMLB) DeleteLoadBalancerOrigin

func (e *EMLB) DeleteLoadBalancerOrigin(ctx context.Context, machineScope *scope.MachineScope) error

DeleteLoadBalancerOrigin deletes the Equinix Metal Load Balancer associated with a given ClusterScope.

func (*EMLB) DeleteLoadBalancerPool

func (e *EMLB) DeleteLoadBalancerPool(ctx context.Context, poolID string) (*http.Response, error)

DeleteLoadBalancerPool deletes an Equinix Metal Load Balancer Origin Pool given an ID.

func (*EMLB) GetLoadBalancerPools

func (e *EMLB) GetLoadBalancerPools(ctx context.Context) (*lbaas.LoadBalancerPoolCollection, *http.Response, error)

GetLoadBalancerPools returns a Load Balancer Collection of all the Equinix Metal Load Balancers in a project.

func (*EMLB) GetLoadBalancers

func (e *EMLB) GetLoadBalancers(ctx context.Context) (*lbaas.LoadBalancerCollection, *http.Response, error)

GetLoadBalancers returns a Load Balancer Collection of all the Equinix Metal Load Balancers in a project.

func (*EMLB) ReconcileLoadBalancer

func (e *EMLB) ReconcileLoadBalancer(ctx context.Context, clusterScope *scope.ClusterScope) error

ReconcileLoadBalancer creates a new Equinix Metal Load Balancer and associates it with the given ClusterScope.

func (*EMLB) ReconcileVIPOrigin

func (e *EMLB) ReconcileVIPOrigin(ctx context.Context, machineScope *scope.MachineScope, deviceAddr []corev1.NodeAddress) error

ReconcileVIPOrigin adds the external IP of a new device to the EMLB Load balancer origin pool.

type Pools

type Pools map[int32][]Target

Pools is a map of a port to Targets.

type Target

type Target struct {
	IP   string
	Port int32
}

Target is a struct containing an IP address and a port.

type TokenExchanger

type TokenExchanger struct {
	// contains filtered or unexported fields
}

TokenExchanger is an client for authenticating to the Load Balancer API.

func (*TokenExchanger) Token

func (m *TokenExchanger) Token() (*oauth2.Token, error)

Token creates a Token object to authenticate with the Load Balancer API.

type TokenResponse

type TokenResponse struct {
	oauth2.Token
	ExpiresIn int64 `json:"expires_in,omitempty"`
}

TokenResponse adds ExpiresIn to the OauthResponse struct.

Jump to

Keyboard shortcuts

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