ns

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2016 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetNS

func SetNS(f *os.File, flags uintptr) error

SetNS sets the network namespace on a target file.

func WithNetNS

func WithNetNS(ns *os.File, lockThread bool, f func(*os.File) error) error

WithNetNS executes the passed closure under the given network namespace, restoring the original namespace afterwards. Changing namespaces must be done on a goroutine that has been locked to an OS thread. If lockThread arg is true, this function locks the goroutine prior to change namespace and unlocks before returning. If the closure returns an error, WithNetNS attempts to restore the original namespace before returning.

func WithNetNSPath

func WithNetNSPath(nspath string, lockThread bool, f func(*os.File) error) error

WithNetNSPath executes the passed closure under the given network namespace, restoring the original namespace afterwards. Changing namespaces must be done on a goroutine that has been locked to an OS thread. If lockThread arg is true, this function locks the goroutine prior to change namespace and unlocks before returning

Types

This section is empty.

Jump to

Keyboard shortcuts

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