ipallocator

package
v0.0.0-...-a9f714a Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2016 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DBFile is the file the bolt ndatabase is stored in.
	DBFile = "bolt.db"
	// IPBucket is the bolt database bucket for ip key value store.
	IPBucket = []byte("ipallocator")
)

Functions

This section is empty.

Types

type IPAllocator

type IPAllocator struct {
	Bridge *net.Interface
	IPNet  *net.IPNet
	// contains filtered or unexported fields
}

IPAllocator defines the data structure for allocating a new IP.

func New

func New(bridgeName, stateDir string, ipNet *net.IPNet) (*IPAllocator, error)

New returns a new instance of IPAllocator for the bridge interface passed.

func (*IPAllocator) Allocate

func (i *IPAllocator) Allocate(pid int) (ip net.IP, err error)

Allocate returns an unused IP from the IPAllocator

Jump to

Keyboard shortcuts

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