local

package
v0.1.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NsCreate

func NsCreate() (netns.NsHandle, error)

NsCreate returns a handle to a new network namespace. NsEnter must be used to safely enter and exit the new namespace.

func NsEnter

func NsEnter(ns netns.NsHandle) (func() error, error)

NsEnter locks the current goroutine the OS thread and switches to a new network namespace. The returned function must be called in order to restore the previous state and unlock the thread.

Types

type ConfigDrive

type ConfigDrive struct {
	Directory string
}

func NewConfigDrive

func NewConfigDrive(userdata string) (*ConfigDrive, error)

func (*ConfigDrive) Destroy

func (d *ConfigDrive) Destroy() error

type Dnsmasq

type Dnsmasq struct {
	Segments []*Segment
	// contains filtered or unexported fields
}

func NewDnsmasq

func NewDnsmasq() (*Dnsmasq, error)

func (*Dnsmasq) Destroy

func (dm *Dnsmasq) Destroy() error

func (*Dnsmasq) GetInterface

func (dm *Dnsmasq) GetInterface(bridge string) (in *Interface)

type Interface

type Interface struct {
	HardwareAddr net.HardwareAddr
	DHCPv4       []net.IPNet
	DHCPv6       []net.IPNet
}

type LocalCluster

type LocalCluster struct {
	destructor.MultiDestructor
	Dnsmasq     *Dnsmasq
	NTPServer   *ntp.Server
	OmahaServer *omaha.Server
	SSHAgent    *network.SSHAgent
	SimpleEtcd  *SimpleEtcd
	// contains filtered or unexported fields
}

func NewLocalCluster

func NewLocalCluster() (*LocalCluster, error)

func (*LocalCluster) GetDiscoveryURL

func (lc *LocalCluster) GetDiscoveryURL(size int) (string, error)

func (*LocalCluster) NewCommand

func (lc *LocalCluster) NewCommand(name string, arg ...string) exec.Cmd

func (*LocalCluster) NewTap

func (lc *LocalCluster) NewTap(bridge string) (*TunTap, error)

type NsCmd

type NsCmd struct {
	*exec.ExecCmd
	NsHandle netns.NsHandle
}

func NewNsCommand

func NewNsCommand(ns netns.NsHandle, name string, arg ...string) *NsCmd

func (*NsCmd) CombinedOutput

func (cmd *NsCmd) CombinedOutput() ([]byte, error)

func (*NsCmd) Output

func (cmd *NsCmd) Output() ([]byte, error)

func (*NsCmd) Run

func (cmd *NsCmd) Run() error

func (*NsCmd) Start

func (cmd *NsCmd) Start() error

type NsDialer

type NsDialer struct {
	network.RetryDialer
	NsHandle netns.NsHandle
}

NsDialer is a RetryDialer that can enter any network namespace.

func NewNsDialer

func NewNsDialer(ns netns.NsHandle) *NsDialer

func (*NsDialer) Dial

func (d *NsDialer) Dial(network, address string) (net.Conn, error)

type Segment

type Segment struct {
	BridgeName string
	BridgeIf   *Interface
	Interfaces []*Interface
	// contains filtered or unexported fields
}

type SimpleEtcd

type SimpleEtcd struct {
	Port int
	// contains filtered or unexported fields
}

SimpleEtcd provides a single node etcd server.

func NewSimpleEtcd

func NewSimpleEtcd() (*SimpleEtcd, error)

func (*SimpleEtcd) Destroy

func (se *SimpleEtcd) Destroy() error

type TunTap

type TunTap struct {
	*netlink.LinkAttrs
	*os.File
}

Tun/Tap device that is compatible with the netlink library.

func AddLinkTap

func AddLinkTap(name string) (*TunTap, error)

func AddLinkTun

func AddLinkTun(name string) (*TunTap, error)

func (*TunTap) Attrs

func (tt *TunTap) Attrs() *netlink.LinkAttrs

func (*TunTap) Type

func (tt *TunTap) Type() string

Jump to

Keyboard shortcuts

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