executor

package
v0.0.0-...-92a250d Latest Latest
Warning

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

Go to latest
Published: May 12, 2016 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NamespaceDecoratorFactory

func NamespaceDecoratorFactory(logger lager.Logger, ns namespace.Namespace) dns.DecorateWriter

Types

type AddressManager

type AddressManager interface {
	AddAddress(interfaceName string, address *net.IPNet) error
}

type Command

type Command interface {
	Execute(context Context) error
	String() string
}

type Condition

type Condition interface {
	Satisfied(context Context) (bool, error)
	String() string
}

type Context

type Context interface {
	Logger() lager.Logger
	AddressManager() AddressManager
	LinkFactory() LinkFactory
	RouteManager() RouteManager
	SandboxNamespaceRepository() namespace.Repository
	SandboxRepository() SandboxRepository
	ListenerFactory() ListenerFactory
	DNSServerFactory() DNSServerFactory
}

type DNSFactory

type DNSFactory struct {
	Logger           lager.Logger
	ExternalServer   string
	DucatiAPI        string
	Suffix           string
	DecoratorFactory writerDecoratorFactory
}

func (*DNSFactory) New

func (f *DNSFactory) New(listener net.PacketConn, sandboxNS namespace.Namespace) ifrit.Runner

type DNSServerFactory

type DNSServerFactory interface {
	New(listener net.PacketConn, ns namespace.Namespace) ifrit.Runner
}

type Executor

type Executor interface {
	Execute(Command) error
}

func New

func New(
	logger lager.Logger,
	addressManager AddressManager,
	routeManager RouteManager,
	linkFactory LinkFactory,
	sandboxNamespaceRepository namespace.Repository,
	sandboxRepository SandboxRepository,
	listenerFactory ListenerFactory,
	dnsServerFactory DNSServerFactory,
) Executor

type LinkFactory

type LinkFactory interface {
	CreateBridge(name string) error
	CreateDummy(name string) error
	CreateVeth(name, peerName string, mtu int) error
	CreateVxlan(name string, vni int) error
	DeleteLinkByName(name string) error
	Exists(name string) bool
	HardwareAddress(linkName string) (net.HardwareAddr, error)
	SetMaster(slave, master string) error
	SetNamespace(intefaceName string, fd uintptr) error
	SetUp(name string) error
	VethDeviceCount() (int, error)
}

type ListenUDPFunc

type ListenUDPFunc func(network string, address *net.UDPAddr) (*net.UDPConn, error)

func (ListenUDPFunc) ListenUDP

func (l ListenUDPFunc) ListenUDP(network string, address *net.UDPAddr) (*net.UDPConn, error)

type ListenerFactory

type ListenerFactory interface {
	ListenUDP(network string, address *net.UDPAddr) (*net.UDPConn, error)
}

type NamespaceWriter

type NamespaceWriter struct {
	Logger    lager.Logger
	Namespace namespace.Namespace
	Writer    writer
}

func (*NamespaceWriter) Write

func (nsw *NamespaceWriter) Write(contents []byte) (int, error)

type RouteManager

type RouteManager interface {
	AddRoute(interfaceName string, destination *net.IPNet, gateway net.IP) error
}

type SandboxRepository

type SandboxRepository interface {
	Create(sandboxName string) (sandbox.Sandbox, error)
	Get(sandboxName string) (sandbox.Sandbox, error)
	Destroy(sandboxName string) error
}

type WriterDecoratorFactoryFunc

type WriterDecoratorFactoryFunc func(logger lager.Logger, ns namespace.Namespace) dns.DecorateWriter

func (WriterDecoratorFactoryFunc) Decorate

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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