doc.go 544 B

123456789
  1. // Package netns allows ultra-simple network namespace handling. NsHandles
  2. // can be retrieved and set. Note that the current namespace is thread
  3. // local so actions that set and reset namespaces should use LockOSThread
  4. // to make sure the namespace doesn't change due to a goroutine switch.
  5. // It is best to close NsHandles when you are done with them. This can be
  6. // accomplished via a `defer ns.Close()` on the handle. Changing namespaces
  7. // requires elevated privileges, so in most cases this code needs to be run
  8. // as root.
  9. package netns