ippool

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IPPool

type IPPool struct {
	IPSubnet *net.IPNet
	Pool     *LazyReusePool
}

func NewIPPool

func NewIPPool(cidr string) (*IPPool, error)

func (*IPPool) Allocate

func (p *IPPool) Allocate(request net.IP) (net.IP, error)

func (*IPPool) Exclude

func (p *IPPool) Exclude(excludePool *IPPool) error

func (*IPPool) Reallocate

func (p *IPPool) Reallocate(request net.IP) (net.IP, bool)

func (*IPPool) Release

func (p *IPPool) Release(ip net.IP) error

func (*IPPool) String

func (p *IPPool) String() string

type LazyReusePool

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

func NewLazyReusePool

func NewLazyReusePool(first, last int) (*LazyReusePool, error)

NewLazyReusePool makes a LazyReusePool.

func (*LazyReusePool) Allocate

func (p *LazyReusePool) Allocate() (res int, ok bool)

func (*LazyReusePool) Contains

func (p *LazyReusePool) Contains(first, last int) bool

func (*LazyReusePool) Dump

func (p *LazyReusePool) Dump() [][]int

func (*LazyReusePool) Free

func (p *LazyReusePool) Free(value int) bool

func (*LazyReusePool) IsJoint

func (p1 *LazyReusePool) IsJoint(p2 *LazyReusePool) bool

func (*LazyReusePool) Max

func (p *LazyReusePool) Max() int

func (*LazyReusePool) Min

func (p *LazyReusePool) Min() int

func (*LazyReusePool) Remain

func (p *LazyReusePool) Remain() int

func (*LazyReusePool) Reserve

func (p *LazyReusePool) Reserve(first, last int) error

func (*LazyReusePool) Total

func (p *LazyReusePool) Total() int

func (*LazyReusePool) Use

func (p *LazyReusePool) Use(value int) bool

Jump to

Keyboard shortcuts

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