namespace

package
v0.0.0-...-8f08c3e Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NamespaceErrorFormat  string = "error:%s"
	NamespaceReturnFormat string = "ret:%s"
)
View Source
const (
	MethodGetNamespace string = "Get"
	MethodPutNamespace string = "Put"
)

Variables

This section is empty.

Functions

func NewNamespaceService

func NewNamespaceService(root string) (service.Service, error)

func OpenNSFd

func OpenNSFd(t NamespaceType, pid int) (int, error)

func PutNamespaceFunction

func PutNamespaceFunction(op NamespaceOpType, t NamespaceType, f NamespaceFunction)

Types

type GetNamespaceRequest

type GetNamespaceRequest struct {
	T   NamespaceType
	Arg interface{}
}

type GetNamespaceResponse

type GetNamespaceResponse struct {
	NSId int
	Pid  int
	Fd   int
	Info interface{}
}

type NamespaceFunction

type NamespaceFunction func(args ...interface{}) error

type NamespaceOpType

type NamespaceOpType string
const (
	NamespaceOpCreate  NamespaceOpType = "create"
	NamespaceOpRelease NamespaceOpType = "release"
)

type NamespaceType

type NamespaceType string
const (
	IPC NamespaceType = "ipc"
	UTS NamespaceType = "uts"
	MNT NamespaceType = "mnt"
)

type PutNamespaceRequest

type PutNamespaceRequest struct {
	T  NamespaceType
	ID int
}

type PutNamespaceResponse

type PutNamespaceResponse struct {
	Error string
}

Jump to

Keyboard shortcuts

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