bridgemgr

package
v0.333.2-candidate Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2016 License: Apache-2.0 Imports: 8 Imported by: 24

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBridgeNameGenerator

func NewBridgeNameGenerator(prefix string) *bridgeNameGenerator

Types

type BridgeManager

type BridgeManager interface {
	// Reserve reserves a bridge name for a subnet.
	// if this is the first call of 'reserve' for a subnet created a new, unique bridge name
	Reserve(subnet *net.IPNet, containerId string) (string, error)

	// Rereserves adds a container to the list of reservations for a particular bridge name.
	Rereserve(bridgeName string, subnet *net.IPNet, containerId string) error

	// Release releases a reservation made by a particular container.
	// If this is the last reservation, the passed destroyers Destroy method is called.
	Release(bridgeName string, containerId string) error

	// Prune deletes all bridges starting with prefix, that are unknown.
	Prune() error
}

func New

func New(prefix string, builder Builder, lister Lister) BridgeManager

type BridgeNameGenerator

type BridgeNameGenerator interface {
	Generate() string
}

type Builder

type Builder interface {
	Create(name string, ip net.IP, subnet *net.IPNet) (intf *net.Interface, err error)
	Destroy(name string) error
}

type Lister

type Lister interface {
	List() ([]string, error)
}

Directories

Path Synopsis
This file was generated by counterfeiter
This file was generated by counterfeiter

Jump to

Keyboard shortcuts

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