package ns
import "github.com/containernetworking/cni/pkg/ns"
Index ¶
- func SetNS(f *os.File, flags uintptr) error
- func WithNetNS(ns *os.File, lockThread bool, f func(*os.File) error) error
- func WithNetNSPath(nspath string, lockThread bool, f func(*os.File) error) error
Functions ¶
func SetNS ¶
SetNS sets the network namespace on a target file.
func WithNetNS ¶
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 ¶
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
Source Files ¶
- Version
- v0.2.3
- Published
- May 12, 2016
- Platform
- js/wasm
- Imports
- 4 packages
- Last checked
- 2 days ago –
Tools for package owners.