kawasaki

package
v0.0.0-...-53a29fe Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2015 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConfigurer

func NewConfigurer(hostConfigurer HostConfigurer, containerApplier ContainerApplier, ipTablesConfigurer IPTablesConfigurer, nsExecer NetnsExecer) *configurer

Types

type ConfigCreator

type ConfigCreator interface {
	Create(log lager.Logger, handle string, subnet *net.IPNet, ip net.IP) (NetworkConfig, error)
}

type ConfigStore

type ConfigStore interface {
	Set(handle string, name string, value string)
	Get(handle string, name string) (string, error)
}

type Configurer

type Configurer interface {
	Apply(log lager.Logger, cfg NetworkConfig, nsPath string) error
	Destroy(log lager.Logger, cfg NetworkConfig) error
}

type ContainerApplier

type ContainerApplier interface {
	Apply(cfg NetworkConfig) error
}

type Creator

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

func NewConfigCreator

func NewConfigCreator(idGenerator IDGenerator, interfacePrefix, chainPrefix string, externalIP net.IP) *Creator

func (*Creator) Create

func (c *Creator) Create(log lager.Logger, handle string, subnet *net.IPNet, ip net.IP) (NetworkConfig, error)

type HostConfigurer

type HostConfigurer interface {
	Apply(cfg NetworkConfig, netnsFD *os.File) error
	Destroy(cfg NetworkConfig) error
}

type IDGenerator

type IDGenerator interface {
	Generate() string
}

func NewSequentialIDGenerator

func NewSequentialIDGenerator(seed int64) IDGenerator

type IPTablesConfigurer

type IPTablesConfigurer interface {
	Apply(instanceChain, bridgeName string, ip net.IP, network *net.IPNet) error
	Destroy(instanceChain string) error
}

type NetnsExecer

type NetnsExecer interface {
	Exec(netnsFD *os.File, cb func() error) error
}

type NetnsMgr

type NetnsMgr interface {
	Create(log lager.Logger, handle string) error
	Lookup(log lager.Logger, handle string) (string, error)
	Destroy(log lager.Logger, handle string) error
}

func NewManager

func NewManager(runner command_runner.CommandRunner, netnsDir string) NetnsMgr

type NetworkConfig

type NetworkConfig struct {
	HostIntf      string
	ContainerIntf string
	IPTableChain  string
	BridgeName    string
	BridgeIP      net.IP
	ContainerIP   net.IP
	ExternalIP    net.IP
	Subnet        *net.IPNet
	Mtu           int
}

type Networker

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

func New

func New(netnsMgr NetnsMgr,
	specParser SpecParser,
	subnetPool subnets.Pool,
	configCreator ConfigCreator,
	configurer Configurer,
	configStore ConfigStore,
	portForwarder PortForwarder,
	portPool PortPool) *Networker

func (*Networker) Capacity

func (n *Networker) Capacity() uint64

Capacity returns the number of subnets this network can host

func (*Networker) Destroy

func (n *Networker) Destroy(log lager.Logger, handle string) error

func (*Networker) NetIn

func (n *Networker) NetIn(handle string, externalPort, containerPort uint32) (uint32, uint32, error)

func (*Networker) Network

func (n *Networker) Network(log lager.Logger, handle, spec string) (string, error)

Network configures a network namespace based on the given spec and returns the path to it

type PortForwarder

type PortForwarder interface {
	Forward(spec *PortForwarderSpec) error
}

type PortForwarderSpec

type PortForwarderSpec struct {
	FromPort     uint32
	ToPort       uint32
	IPTableChain string
	ContainerIP  net.IP
	ExternalIP   net.IP
}

type PortPool

type PortPool interface {
	Acquire() (uint32, error)
}

type SpecParser

type SpecParser interface {
	Parse(log lager.Logger, spec string) (subnets.SubnetSelector, subnets.IPSelector, error)
}

type SpecParserFunc

type SpecParserFunc func(spec string) (subnets.SubnetSelector, subnets.IPSelector, error)

func (SpecParserFunc) Parse

Directories

Path Synopsis
This file was generated by counterfeiter
This file was generated by counterfeiter
fakes
This file was generated by counterfeiter
This file was generated by counterfeiter
The subnets package provides a subnet pool from which networks may be dynamically acquired or statically reserved.
The subnets package provides a subnet pool from which networks may be dynamically acquired or statically reserved.
fake_subnet_pool
This file was generated by counterfeiter
This file was generated by counterfeiter
fakes
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
JackTT - Gopher 🇻🇳