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

	DestroyCalledWith []string

	DestroyReturns 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) Destroy

func (f *FakeBridge) Destroy(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
		Fd        int
	}

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

	AddIPReturns        map[string]error
	AddDefaultGWReturns error
	SetMTUReturns       error
	SetNsReturns        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, fd int) error

func (*FakeLink) SetUp

func (f *FakeLink) SetUp(intf *net.Interface) 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
}

Source Files