Versions in this module Expand all Collapse all v1 v1.16.3 Nov 9, 2022 Changes in this version + var ErrAllocated = errors.New("provided IP is already allocated") + var ErrFull = errors.New("range is full") + var ErrMismatchedNetwork = errors.New("the provided network does not match the current range") + func GetIndexedIP(subnet *net.IPNet, index int) (net.IP, error) + func RangeSize(subnet *net.IPNet) int64 + type ErrNotInRange struct + ValidRange string + func (e *ErrNotInRange) Error() string + type Interface interface + Allocate func(net.IP) error + AllocateNext func() (net.IP, error) + CIDR func() net.IPNet + ForEach func(func(net.IP)) + Has func(ip net.IP) bool + Release func(net.IP) error + type Range struct + func NewAllocatorCIDRRange(cidr *net.IPNet, allocatorFactory allocator.AllocatorFactory) (*Range, error) + func NewCIDRRange(cidr *net.IPNet) (*Range, error) + func NewFromSnapshot(snap *api.RangeAllocation) (*Range, error) + func (r *Range) Allocate(ip net.IP) error + func (r *Range) AllocateNext() (net.IP, error) + func (r *Range) CIDR() net.IPNet + func (r *Range) ForEach(fn func(net.IP)) + func (r *Range) Free() int + func (r *Range) Has(ip net.IP) bool + func (r *Range) Release(ip net.IP) error + func (r *Range) Restore(net *net.IPNet, data []byte) error + func (r *Range) Snapshot(dst *api.RangeAllocation) error + func (r *Range) Used() int