vip

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package vip contains implementations of specific methods to acquire/release virtual IPs.

Index

Constants

View Source
const EquinixMetalMetaDataEndpoint = "https://metadata.platformequinix.com/metadata"

EquinixMetalMetaDataEndpoint is the local endpoint for machine info like networking.

View Source
const HCloudMetaDataEndpoint = "http://169.254.169.254/hetzner/v1/metadata/instance-id"

HCloudMetaDataEndpoint is the local endpoint for machine info like networking.

Variables

This section is empty.

Functions

func GetNetworkAndDeviceIDs

func GetNetworkAndDeviceIDs(ctx context.Context, spec *network.VIPHCloudSpec, vip netip.Addr) error

GetNetworkAndDeviceIDs fills in parts of the spec based on the API token and instance metadata.

func GetProjectAndDeviceIDs

func GetProjectAndDeviceIDs(ctx context.Context, spec *network.VIPEquinixMetalSpec) error

GetProjectAndDeviceIDs fills in parts of the spec based on the API token and instance metadata.

Types

type EquinixMetalHandler

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

EquinixMetalHandler implements assignment and release of Virtual IPs using API.

func NewEquinixMetalHandler

func NewEquinixMetalHandler(logger *zap.Logger, vip string, spec network.VIPEquinixMetalSpec) *EquinixMetalHandler

NewEquinixMetalHandler creates new EquinixMetalHandler.

func (*EquinixMetalHandler) Acquire

func (handler *EquinixMetalHandler) Acquire(ctx context.Context) error

Acquire implements Handler interface.

func (*EquinixMetalHandler) Release

func (handler *EquinixMetalHandler) Release(ctx context.Context) error

Release implements Handler interface.

type HCloudHandler

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

HCloudHandler implements assignment and release of Virtual IPs using API.

func NewHCloudHandler

func NewHCloudHandler(logger *zap.Logger, vip string, spec network.VIPHCloudSpec) *HCloudHandler

NewHCloudHandler creates new NewEHCloudHandler.

func (*HCloudHandler) Acquire

func (handler *HCloudHandler) Acquire(ctx context.Context) error

Acquire implements Handler interface.

func (*HCloudHandler) Release

func (handler *HCloudHandler) Release(ctx context.Context) error

Release implements Handler interface.

type Handler

type Handler interface {
	Acquire(ctx context.Context) error
	Release(ctx context.Context) error
}

Handler implements custom actions to manage virtual IP assignment.

type NopHandler

type NopHandler struct{}

NopHandler does nothing.

func (NopHandler) Acquire

func (handler NopHandler) Acquire(ctx context.Context) error

Acquire implements Handler interface.

func (NopHandler) Release

func (handler NopHandler) Release(ctx context.Context) error

Release implements Handler interface.

Jump to

Keyboard shortcuts

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