ipam

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2015 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMixedConfig = errors.New("Mixed IPAM/non-IPAM configuration not supported")
)

Functions

This section is empty.

Types

type Allocator

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

Allocator brings together Ring and space.Set, and does the necessary plumbing. Runs as a single-threaded Actor, so no locks are used around data structures.

func NewAllocator

func NewAllocator(ourName router.PeerName, ourUID router.PeerUID, ourNickname string, subnetCIDR string, quorum uint) (*Allocator, error)

NewAllocator creates and initialises a new Allocator

func (*Allocator) AdminTakeoverRanges

func (alloc *Allocator) AdminTakeoverRanges(peerNameOrNickname string) error

AdminTakeoverRanges (Sync) - take over the ranges owned by a given peer. Only done on adminstrator command.

func (*Allocator) Allocate

func (alloc *Allocator) Allocate(ident string, cancelChan <-chan bool) (address.Address, error)

Allocate (Sync) - get IP address for container with given name if there isn't any space we block indefinitely

func (*Allocator) Claim

func (alloc *Allocator) Claim(ident string, addr address.Address, cancelChan <-chan bool) error

Claim an address that we think we should own (Sync)

func (*Allocator) ContainerDied

func (alloc *Allocator) ContainerDied(ident string) error

ContainerDied is provided to satisfy the updater interface; does a free underneath. Async.

func (*Allocator) Encode

func (alloc *Allocator) Encode() []byte

Encode (Sync)

func (*Allocator) Free

func (alloc *Allocator) Free(ident string) error

Free (Sync) - release IP address for container with given name

func (*Allocator) Gossip

func (alloc *Allocator) Gossip() router.GossipData

Gossip returns a GossipData implementation, which in this case always returns the latest ring state (and does nothing on merge)

func (*Allocator) HandleHTTP

func (alloc *Allocator) HandleHTTP(router *mux.Router)

HandleHTTP wires up ipams HTTP endpoints to the provided mux.

func (*Allocator) OnGossip

func (alloc *Allocator) OnGossip(msg []byte) (router.GossipData, error)

OnGossip (Sync)

func (*Allocator) OnGossipBroadcast

func (alloc *Allocator) OnGossipBroadcast(msg []byte) (router.GossipData, error)

OnGossipBroadcast (Sync)

func (*Allocator) OnGossipUnicast

func (alloc *Allocator) OnGossipUnicast(sender router.PeerName, msg []byte) error

OnGossipUnicast (Sync)

func (*Allocator) SetInterfaces

func (alloc *Allocator) SetInterfaces(gossip router.Gossip)

SetInterfaces gives the allocator two interfaces for talking to the outside world

func (*Allocator) Shutdown

func (alloc *Allocator) Shutdown()

Shutdown (Sync)

func (*Allocator) Start

func (alloc *Allocator) Start()

Start runs the allocator goroutine

func (*Allocator) Stop

func (alloc *Allocator) Stop()

Stop makes the actor routine exit, for test purposes ONLY because any calls after this is processed will hang. Async.

func (*Allocator) String

func (alloc *Allocator) String() string

Sync.

type DummyAllocator

type DummyAllocator struct {
}

Exists solely for the purpose of detecting a network in which some peers are configured with IPAM on and some with IPAM off.

func (*DummyAllocator) Encode

func (alloc *DummyAllocator) Encode() []byte

func (*DummyAllocator) Gossip

func (alloc *DummyAllocator) Gossip() router.GossipData

func (*DummyAllocator) OnGossip

func (alloc *DummyAllocator) OnGossip(msg []byte) (router.GossipData, error)

func (*DummyAllocator) OnGossipBroadcast

func (alloc *DummyAllocator) OnGossipBroadcast(msg []byte) (router.GossipData, error)

func (*DummyAllocator) OnGossipUnicast

func (alloc *DummyAllocator) OnGossipUnicast(sender router.PeerName, msg []byte) error

Directories

Path Synopsis
Package ring implements a simple ring CRDT.
Package ring implements a simple ring CRDT.

Jump to

Keyboard shortcuts

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