namespace

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CLONE_NEWUTS Work
	CLONE_NEWUTS = unix.CLONE_NEWUTS

	// CLONE_NEWNS Maybe work
	CLONE_NEWNS = unix.CLONE_NEWNS

	// CLONE_NEWCGROUP Don`t test
	CLONE_NEWCGROUP = unix.CLONE_NEWCGROUP

	// CLONE_NEWTIME Maybe work
	CLONE_NEWTIME = unix.CLONE_NEWTIME

	// CLONE_NEWIPC Work
	CLONE_NEWIPC = unix.CLONE_NEWIPC //Work

	// CLONE_NEWUSER Don`t work
	CLONE_NEWUSER = unix.CLONE_NEWUSER

	// CLONE_NEWPID Don`t work
	CLONE_NEWPID = unix.CLONE_NEWPID

	// CLONE_NEWNET Work
	CLONE_NEWNET = unix.CLONE_NEWNET //Work

	// CLONE_IO Dont test
	CLONE_IO = unix.CLONE_IO
)

Variables

View Source
var CloneFlags = map[string]int{
	// contains filtered or unexported fields
}
View Source
var NSs = []string{pidPath, userPath, utsPath, mntPath, netPath, timePath, ipcPath, cgroupPath}

Functions

func ChangeDir

func ChangeDir(path string) error

func ChangeRoot

func ChangeRoot(path string) error

func NewWrapper

func NewWrapper(NSs []string, f func()) error

func OpenNS

func OpenNS(path string) (int, error)

func PivotRoot

func PivotRoot(newroot, oldroot string) error

func RemoveNetNamed

func RemoveNetNamed(name string) error

Types

type Namespace

type Namespace struct {
	// contains filtered or unexported fields
}

func Current

func Current() (*Namespace, error)

func FromPid

func FromPid(pid int) (*Namespace, error)

func FromThread

func FromThread(pid, tid int) (*Namespace, error)

func NetFromName

func NetFromName(name string) (*Namespace, error)

func New

func New(NSs []string) (*Namespace, error)

func NewNetNamed

func NewNetNamed(name string, NSs []string) (*Namespace, error)

func (*Namespace) Close

func (ns *Namespace) Close() error

func (*Namespace) CloseNS

func (ns *Namespace) CloseNS(nstype string) error

func (*Namespace) Equal

func (ns *Namespace) Equal(other *Namespace) bool

func (*Namespace) EqualNS

func (ns *Namespace) EqualNS(other *Namespace, nstype string) bool

func (*Namespace) IsOpen

func (ns *Namespace) IsOpen() bool

func (*Namespace) IsOpenNS

func (ns *Namespace) IsOpenNS(nstype string) bool

func (*Namespace) Set

func (ns *Namespace) Set(NSs []string) error

func (*Namespace) SetType

func (ns *Namespace) SetType(nstypes []string)

func (*Namespace) Wrapper

func (ns *Namespace) Wrapper(NSs []string, f func()) error

type Namespaces

type Namespaces struct {
	// contains filtered or unexported fields
}

type NamespacesFd

type NamespacesFd struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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