ipam

package
v0.20.0-m0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: Apache-2.0 Imports: 8 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StringIPToInt

func StringIPToInt(stringIP string) uint32

Types

type IPPool

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

func NewIPPool

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

func (*IPPool) Allocate

func (p *IPPool) Allocate(num int) ([]string, error)

func (*IPPool) GetCIDR

func (p *IPPool) GetCIDR() string

func (*IPPool) Release

func (p *IPPool) Release(ips ...string) error

func (*IPPool) Reserve

func (p *IPPool) Reserve(ips ...string) error

func (*IPPool) Size

func (p *IPPool) Size() int

type MetricsReporter

type MetricsReporter interface {
	RecordAvailability(cidr string, count int)
	RecordIPsAllocated(cidr string, count int)
	RecordIPDeallocated(cidr string)
}

type MetricsReporterFuncs

type MetricsReporterFuncs struct {
	RecordAvailabilityFunc  func(cidr string, count int)
	RecordIPsAllocatedFunc  func(cidr string, count int)
	RecordIPDeallocatedFunc func(cidr string)
}

func (MetricsReporterFuncs) RecordAvailability

func (r MetricsReporterFuncs) RecordAvailability(cidr string, count int)

func (MetricsReporterFuncs) RecordIPDeallocated

func (r MetricsReporterFuncs) RecordIPDeallocated(cidr string)

func (MetricsReporterFuncs) RecordIPsAllocated

func (r MetricsReporterFuncs) RecordIPsAllocated(cidr string, count int)

Jump to

Keyboard shortcuts

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