Documentation ¶
Index ¶
- Variables
- func ChangeInterfaceName(old, newName string) error
- func CreateVethPair(name1, name2 string) error
- func InterfaceDown(name string) error
- func InterfaceUp(name string) error
- func SetDefaultGateway(ip, ifaceName string) error
- func SetInterfaceInNamespacePid(name string, nsPid int) error
- func SetInterfaceIp(name string, rawIp string) error
- func SetInterfaceMaster(name, master string) error
- func SetMtu(name string, mtu int) error
- type Loopback
- type NetNS
- type NetworkStrategy
- type Veth
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotValidStrategyType = errors.New("not a valid network strategy type")
)
Functions ¶
func ChangeInterfaceName ¶
func CreateVethPair ¶
func InterfaceDown ¶
func InterfaceUp ¶
func SetDefaultGateway ¶
func SetInterfaceIp ¶
func SetInterfaceMaster ¶
Types ¶
type Loopback ¶
type Loopback struct { }
Loopback is a network strategy that provides a basic loopback device
func (*Loopback) Create ¶
func (l *Loopback) Create(n *libcontainer.Network, nspid int, context libcontainer.Context) error
func (*Loopback) Initialize ¶
func (l *Loopback) Initialize(config *libcontainer.Network, context libcontainer.Context) error
type NetNS ¶
type NetNS struct { }
crosbymichael: could make a network strategy that instead of returning veth pair names it returns a pid to an existing network namespace
func (*NetNS) Create ¶
func (v *NetNS) Create(n *libcontainer.Network, nspid int, context libcontainer.Context) error
func (*NetNS) Initialize ¶
func (v *NetNS) Initialize(config *libcontainer.Network, context libcontainer.Context) error
type NetworkStrategy ¶
type NetworkStrategy interface { Create(*libcontainer.Network, int, libcontainer.Context) error Initialize(*libcontainer.Network, libcontainer.Context) error }
NetworkStrategy represents a specific network configuration for a container's networking stack
func GetStrategy ¶
func GetStrategy(tpe string) (NetworkStrategy, error)
GetStrategy returns the specific network strategy for the provided type. If no strategy is registered for the type an ErrNotValidStrategyType is returned.
type Veth ¶
type Veth struct { }
Veth is a network strategy that uses a bridge and creates a veth pair, one that stays outside on the host and the other is placed inside the container's namespace
func (*Veth) Create ¶
func (v *Veth) Create(n *libcontainer.Network, nspid int, context libcontainer.Context) error
func (*Veth) Initialize ¶
func (v *Veth) Initialize(config *libcontainer.Network, context libcontainer.Context) error
Click to show internal directories.
Click to hide internal directories.