Documentation ¶
Index ¶
Constants ¶
View Source
const ( LinkTypeVeth = LinkType("veth") LinkTypeTap = LinkType("tap") )
Variables ¶
This section is empty.
Functions ¶
func RandomLinkName ¶
RandomLinkName generates a random link name
Types ¶
type NetNS ¶
type NetNS interface { // Setup creates a linux network namespace and runs applications as specified Setup(context.Context, int, bool) error // Cleanup removes network namespaces and veths placemat added Cleanup() // HostVethNames returns host veth names placemat added HostVethNames() []string }
NetNS represents a NetworkNamespace resource.
type Network ¶
type Network interface { // Setup creates a virtual L2 switch using Linux bridge. Setup(int, bool) error // IsType checks whether this Network's type is specified type or not IsType(types.NetworkType) bool // Contains checks whether this Network's address includes specified ip Contains(net.IP) bool // AddAddr adds IP address to this Network AddAddr(string) error // Cleanup deletes all the created bridges and restores all the modified configs. Cleanup() }
Network represents a network configuration
func NewNetwork ¶
func NewNetwork(spec *types.NetworkSpec) (Network, error)
NewNetwork creates *Network from spec.
Click to show internal directories.
Click to hide internal directories.