networkidallocator

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: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type Allocator

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

func NewNetworkIDAllocator

func NewNetworkIDAllocator(
	client v1alpha1client.CoreV1alpha1Interface,
	networkIDInformer v1alpha1informers.NetworkIDInformer,
	minVNI, maxVNI int32,
) (*Allocator, error)

func (*Allocator) AllocateNetwork

func (a *Allocator) AllocateNetwork(network *core.Network, id string) error

func (*Allocator) AllocateNextNetwork

func (a *Allocator) AllocateNextNetwork(network *core.Network) (string, error)

func (*Allocator) DryRun

func (a *Allocator) DryRun() Interface

func (*Allocator) Release

func (a *Allocator) Release(id string) error

type Interface

type Interface interface {
	AllocateNetwork(network *core.Network, id string) error
	AllocateNextNetwork(network *core.Network) (string, error)
	Release(id string) error
	DryRun() Interface
}

Jump to

Keyboard shortcuts

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