fakedevices

package
v0.333.2-candidate Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2016 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeBridge

type FakeBridge struct {
	CreateCalledWith struct {
		Name   string
		IP     net.IP
		Subnet *net.IPNet
	}

	CreateReturns struct {
		Interface *net.Interface
		Error     error
	}

	AddCalledWith struct {
		Bridge, Slave *net.Interface
	}

	AddReturns error

	DeleteCalledWith []string

	DeleteReturns error
}

func (*FakeBridge) Add

func (f *FakeBridge) Add(bridge, slave *net.Interface) error

func (*FakeBridge) Create

func (f *FakeBridge) Create(name string, ip net.IP, subnet *net.IPNet) (*net.Interface, error)

func (*FakeBridge) Delete

func (f *FakeBridge) Delete(bridge string) error
type FakeLink struct {
	AddIPCalledWith        []InterfaceIPAndSubnet
	SetUpCalledWith        []*net.Interface
	AddDefaultGWCalledWith struct {
		Interface *net.Interface
		IP        net.IP
	}

	SetMTUCalledWith struct {
		Interface *net.Interface
		MTU       int
	}

	SetNsCalledWith struct {
		Interface *net.Interface
		Pid       int
	}

	SetUpFunc           func(*net.Interface) error
	InterfaceByNameFunc func(string) (*net.Interface, bool, error)

	AddIPReturns        map[string]error
	AddDefaultGWReturns error
	SetMTUReturns       error
	SetNsReturns        error
	StatisticsReturns   error
}

func (*FakeLink) AddDefaultGW

func (f *FakeLink) AddDefaultGW(intf *net.Interface, ip net.IP) error

func (*FakeLink) AddIP

func (f *FakeLink) AddIP(intf *net.Interface, ip net.IP, subnet *net.IPNet) error

func (*FakeLink) InterfaceByName

func (f *FakeLink) InterfaceByName(name string) (*net.Interface, bool, error)

func (*FakeLink) SetMTU

func (f *FakeLink) SetMTU(intf *net.Interface, mtu int) error

func (*FakeLink) SetNs

func (f *FakeLink) SetNs(intf *net.Interface, pid int) error

func (*FakeLink) SetUp

func (f *FakeLink) SetUp(intf *net.Interface) error

func (*FakeLink) Statistics

func (f *FakeLink) Statistics() (garden.ContainerNetworkStat, error)

type FaveVethCreator

type FaveVethCreator struct {
	CreateCalledWith struct {
		HostIfcName, ContainerIfcName string
	}

	CreateReturns struct {
		Host, Container *net.Interface
		Err             error
	}
}

func (*FaveVethCreator) Create

func (f *FaveVethCreator) Create(hostIfcName, containerIfcName string) (*net.Interface, *net.Interface, error)

type InterfaceIPAndSubnet

type InterfaceIPAndSubnet struct {
	Interface *net.Interface
	IP        net.IP
	Subnet    *net.IPNet
}

Jump to

Keyboard shortcuts

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