nsutil

package
v0.10.0-connect1 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2019 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvCNIPath = "CNI_PATH"
)
View Source
const NetNSRunDir = "/var/run/netns"

NetNSRunDir is the directory which new network namespaces will be bind mounted

Variables

This section is empty.

Functions

func NewNS

func NewNS(nsName string) (ns.NetNS, error)

NewNS creates a new persistent (bind-mounted) network namespace and returns an object representing that namespace, without switching to it.

func SetupBridgeNetworking

func SetupBridgeNetworking(allocID string, nsPath string, portMappings []*PortMapping) error

func TeardownBridgeNetworking

func TeardownBridgeNetworking(allocID, nsPath string, portMappings []*PortMapping) error

func UnmountNS

func UnmountNS(nsPath string) error

UnmountNS unmounts the NS held by the netns object

Types

type PortMapping

type PortMapping struct {
	Host      int    `json:"hostPort"`
	Container int    `json:"containerPort"`
	Proto     string `json:"protocol"`
}

Jump to

Keyboard shortcuts

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