docker

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2013 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultNetworkBridge = "docker0"
	DisableNetworkBridge = "none"
)

Variables

View Source
var NetworkBridgeIface string

Functions

func CreateBridgeIface

func CreateBridgeIface(ifaceName string) error

CreateBridgeIface creates a network bridge interface on the host system with the name `ifaceName`, and attempts to configure it with an address which doesn't conflict with any other interface on the host. If it can't find an address which doesn't conflict, it will return an error.

Types

type IPAllocator

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

IP allocator: Automatically allocate and release networking ports

func (*IPAllocator) Acquire

func (alloc *IPAllocator) Acquire() (net.IP, error)

func (*IPAllocator) Release

func (alloc *IPAllocator) Release(ip net.IP)

type Nat

type Nat struct {
	Proto    string
	Frontend int
	Backend  int
}

type NetworkInterface

type NetworkInterface struct {
	IPNet   net.IPNet
	Gateway net.IP
	// contains filtered or unexported fields
}

Network interface represents the networking stack of a container

func (*NetworkInterface) AllocatePort

func (iface *NetworkInterface) AllocatePort(spec string) (*Nat, error)

Allocate an external TCP port and map it to the interface

func (*NetworkInterface) Release

func (iface *NetworkInterface) Release()

Release: Network cleanup - release all resources

type NetworkManager

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

Network Manager manages a set of network interfaces Only *one* manager per host machine should be used

func (*NetworkManager) Allocate

func (manager *NetworkManager) Allocate() (*NetworkInterface, error)

Allocate a network interface

type PortAllocator

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

Port allocator: Automatically allocate and release networking ports

func (*PortAllocator) Acquire

func (alloc *PortAllocator) Acquire(port int) (int, error)

func (*PortAllocator) Release

func (alloc *PortAllocator) Release(port int) error

FIXME: Release can no longer fail, change its prototype to reflect that.

type PortMapper

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

Port mapper takes care of mapping external ports to containers by setting up iptables rules. It keeps track of all mappings and is able to unmap at will

func (*PortMapper) Map

func (mapper *PortMapper) Map(port int, backendAddr net.Addr) error

func (*PortMapper) Unmap

func (mapper *PortMapper) Unmap(port int, proto string) error

Jump to

Keyboard shortcuts

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