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: 549 modules, 1,163 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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