ipallocator

package
v0.1.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetIPV4Addrs

func GetIPV4Addrs(net string, skipGw bool, skipNetwork bool) ([]string, error)

GetIPV4Addrs will return a slice of strings, each one is an IP Address, part of the CIDR described.

Types

type IPAllocator

type IPAllocator struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func New

func New(iface string, cidr string) (*IPAllocator, error)

func (*IPAllocator) Allocate

func (i *IPAllocator) Allocate() (string, error)

func (*IPAllocator) CleanUp

func (i *IPAllocator) CleanUp()

func (*IPAllocator) Release

func (i *IPAllocator) Release(ipAddress string) error

func (*IPAllocator) ReleaseAll

func (i *IPAllocator) ReleaseAll(fnCleanupEach func(s string) error) error

Jump to

Keyboard shortcuts

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