package netns
import "github.com/containerd/containerd/pkg/netns"
Index ¶
- type NetNS
- func LoadNetNS(path string) *NetNS
- func NewNetNS(baseDir string) (*NetNS, error)
- func NewNetNSFromPID(baseDir string, pid uint32) (*NetNS, error)
- func (n *NetNS) Closed() (bool, error)
- func (n *NetNS) Do(f func(cnins.NetNS) error) error
- func (n *NetNS) GetPath() string
- func (n *NetNS) Remove() error
Types ¶
type NetNS ¶
type NetNS struct {
// contains filtered or unexported fields
}
NetNS holds network namespace.
func LoadNetNS ¶
LoadNetNS loads existing network namespace.
func NewNetNS ¶
NewNetNS creates a network namespace.
func NewNetNSFromPID ¶
NewNetNS returns the netns from pid or a new netns if pid is 0.
func (*NetNS) Closed ¶
Closed checks whether the network namespace has been closed.
func (*NetNS) Do ¶
Do runs a function in the network namespace.
func (*NetNS) GetPath ¶
GetPath returns network namespace path for sandbox container
func (*NetNS) Remove ¶
Remove removes network namespace. Remove is idempotent, meaning it might be invoked multiple times and provides consistent result.
Source Files ¶
- Version
- v1.7.11
- Published
- Dec 8, 2023
- Platform
- linux/amd64
- Imports
- 10 packages
- Last checked
- 4 minutes ago –
Tools for package owners.