namespaces

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeletePid added in v1.0.0

func DeletePid(path string) error

DeletePid removes the pid and started file from disk when the container's process dies and the container is cleanly removed

func Exec added in v1.0.0

func Exec(container *libcontainer.Container, term Terminal, rootfs, dataPath string, args []string, createCommand CreateCommand, startCallback func()) (int, error)

func GetNamespaceFlags added in v1.0.0

func GetNamespaceFlags(namespaces map[string]bool) (flag int)

func Init added in v1.0.0

func Init(container *libcontainer.Container, uncleanRootfs, consolePath string, syncPipe *SyncPipe, args []string) error

func InitializeNetworking added in v1.0.0

func InitializeNetworking(container *libcontainer.Container, nspid int, pipe *SyncPipe) error

func SetupCgroups added in v1.0.0

func SetupCgroups(container *libcontainer.Container, nspid int) (cgroups.ActiveCgroup, error)

func WritePid added in v1.0.0

func WritePid(path string, pid int, startTime string) error

WritePid writes the namespaced processes pid to pid and it's start time to the path specified

Types

type CreateCommand

type CreateCommand func(container *libcontainer.Container, console, rootfs, dataPath, init string, childPipe *os.File, args []string) *exec.Cmd

type StdTerminal added in v1.0.0

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

func (*StdTerminal) Attach added in v1.0.0

func (s *StdTerminal) Attach(command *exec.Cmd) error

func (*StdTerminal) Close added in v1.0.0

func (s *StdTerminal) Close() error

func (*StdTerminal) Resize added in v1.0.0

func (s *StdTerminal) Resize(h, w int) error

func (*StdTerminal) SetMaster added in v1.0.0

func (s *StdTerminal) SetMaster(*os.File)

type SyncPipe added in v1.0.0

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

SyncPipe allows communication to and from the child processes to it's parent and allows the two independent processes to syncronize their state.

func NewSyncPipe added in v1.0.0

func NewSyncPipe() (s *SyncPipe, err error)

func NewSyncPipeFromFd added in v1.0.0

func NewSyncPipeFromFd(parendFd, childFd uintptr) (*SyncPipe, error)

func (*SyncPipe) Child added in v1.0.0

func (s *SyncPipe) Child() *os.File

func (*SyncPipe) Close added in v1.0.0

func (s *SyncPipe) Close() error

func (*SyncPipe) Parent added in v1.0.0

func (s *SyncPipe) Parent() *os.File

func (*SyncPipe) ReadFromParent added in v1.0.0

func (s *SyncPipe) ReadFromParent() (libcontainer.Context, error)

func (*SyncPipe) SendToChild added in v1.0.0

func (s *SyncPipe) SendToChild(context libcontainer.Context) error

type Terminal added in v1.0.0

type Terminal interface {
	io.Closer
	SetMaster(*os.File)
	Attach(*exec.Cmd) error
	Resize(h, w int) error
}

func NewTerminal added in v1.0.0

func NewTerminal(stdin io.Reader, stdout, stderr io.Writer, tty bool) Terminal

type TtyTerminal added in v1.0.0

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

func (*TtyTerminal) Attach added in v1.0.0

func (t *TtyTerminal) Attach(command *exec.Cmd) error

func (*TtyTerminal) Close added in v1.0.0

func (t *TtyTerminal) Close() error

func (*TtyTerminal) Resize added in v1.0.0

func (t *TtyTerminal) Resize(h, w int) error

func (*TtyTerminal) SetMaster added in v1.0.0

func (t *TtyTerminal) SetMaster(master *os.File)

Jump to

Keyboard shortcuts

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