ipaddressallocator

package
v0.2.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFull       = errors.New("all IPs are allocated")
	ErrAllocated  = errors.New("provided IP is already allocated")
	ErrNotInRange = errors.New("the provided IP is not in range")
)

Functions

This section is empty.

Types

type Allocator

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

func (*Allocator) Allocate

func (a *Allocator) Allocate(claimRef v1alpha1.IPAddressClaimRef, ip netip.Addr) error

func (*Allocator) AllocateNext

func (a *Allocator) AllocateNext(claimRef v1alpha1.IPAddressClaimRef) (netip.Addr, error)

func (*Allocator) DryRun

func (a *Allocator) DryRun() Interface

func (*Allocator) IPFamily

func (a *Allocator) IPFamily() corev1.IPFamily

func (*Allocator) Release

func (a *Allocator) Release(ip netip.Addr) error

type Interface

type Interface interface {
	IPFamily() corev1.IPFamily
	Allocate(claimRef v1alpha1.IPAddressClaimRef, ip netip.Addr) error
	AllocateNext(claimRef v1alpha1.IPAddressClaimRef) (netip.Addr, error)
	Release(ip netip.Addr) error
	DryRun() Interface
}

Jump to

Keyboard shortcuts

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