Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct { Start *big.Int End *big.Int Mask net.IPMask // contains filtered or unexported fields }
func (*Block) Allocate ¶
Allocate one ip address from this block, if `ipReq` is not empty, will allocate one ip address not used in sequence
type IPAddressManager ¶
type IPAddressManager struct {
// contains filtered or unexported fields
}
func NewIPAddressManager ¶
func NewIPAddressManager() *IPAddressManager
func (*IPAddressManager) AddAddressBlock ¶
func (m *IPAddressManager) AddAddressBlock(cidr, start, end string) error
AddAddressBlock adds one block allocation pool
func (*IPAddressManager) Allocate ¶
Allocate one ip address from blocks, if `ipReq` is nil, will try to allocate a ip address from blocks in sequence
func (*IPAddressManager) PutBack ¶
func (m *IPAddressManager) PutBack(ip net.IP)
PutBack one ip address
Click to show internal directories.
Click to hide internal directories.