allocator

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoAvailableSubnet     = fmt.Errorf("no subnet available")
	ErrInvalidSubnetMaskSize = fmt.Errorf("invalid subnet mask size")
)

Functions

func IsNoTAvailable

func IsNoTAvailable(err error) bool

Types

type Interface

type Interface interface {
	Record(ipNet net.IPNet) error
	Reclaim(ipNet net.IPNet) error
	IsAllocated(net.IPNet) bool
	Contains(ipNet net.IPNet) bool
	GetFreeSubnetBlock(hostname string) (*net.IPNet, error)
}

func New

func New(netCIDR string, subnetMaskSize int) (Interface, error)

type NextBlockFunc

type NextBlockFunc func() *net.IPNet

Jump to

Keyboard shortcuts

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