goci

package
v0.0.0-...-7f502db Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NetworkNamespace = specs.LinuxNamespace{Type: specs.NetworkNamespace}
	UserNamespace    = specs.LinuxNamespace{Type: specs.UserNamespace}
	PIDNamespace     = specs.LinuxNamespace{Type: specs.PIDNamespace}
	IPCNamespace     = specs.LinuxNamespace{Type: specs.IPCNamespace}
	UTSNamespace     = specs.LinuxNamespace{Type: specs.UTSNamespace}
	MountNamespace   = specs.LinuxNamespace{Type: specs.MountNamespace}
)
View Source
var DefaultRuncBinary = RuncBinary("runc")

The DefaultRuncBinary, i.e. 'runc'.

Functions

func DeleteCommand

func DeleteCommand(id, logFile string) *exec.Cmd

DeleteCommand creates a command that deletes a container using the default runc binary name.

func EventsCommand

func EventsCommand(id string) *exec.Cmd

func ExecCommand

func ExecCommand(id, processJSONPath, pidFilePath string) *exec.Cmd

ExecCommand creates an exec command using the default runc binary name.

func KillCommand

func KillCommand(id, signal, logFile string) *exec.Cmd

KillCommand creates a kill command using the default runc binary name.

func Process

func Process(args ...string) specs.Process

Process returns an OCI Process struct with the given args.

func StartCommand

func StartCommand(path, id string, detach bool, log string) *exec.Cmd

StartCommand creates a start command using the default runc binary name.

func StateCommand

func StateCommand(id, logFile string) *exec.Cmd

StateCommands creates a command that gets the state of a container using the default runc binary name.

func StatsCommand

func StatsCommand(id, logFile string) *exec.Cmd

StatsCommands creates a command that gets the stats of a container using the default runc binary name.

Types

type Bndl

type Bndl struct {
	Spec specs.Spec
}

Bndl represents an in-memory OCI bundle

func Bundle

func Bundle() Bndl

Bundle creates a Bndl

func (Bndl) Capabilities

func (b Bndl) Capabilities() []string

func (*Bndl) CloneLinux

func (b *Bndl) CloneLinux() Bndl

func (Bndl) Devices

func (b Bndl) Devices() []specs.LinuxDevice

func (Bndl) GIDMappings

func (b Bndl) GIDMappings() []specs.LinuxIDMapping

func (Bndl) Hostname

func (b Bndl) Hostname() string

func (Bndl) MaskedPaths

func (b Bndl) MaskedPaths() []string

func (Bndl) Mounts

func (b Bndl) Mounts() []specs.Mount

func (Bndl) Namespaces

func (b Bndl) Namespaces() []specs.LinuxNamespace

func (Bndl) PoststopHooks

func (b Bndl) PoststopHooks() []specs.Hook

func (Bndl) PrestartHooks

func (b Bndl) PrestartHooks() []specs.Hook

func (Bndl) Process

func (b Bndl) Process() specs.Process

func (Bndl) Resources

func (b Bndl) Resources() *specs.LinuxResources

func (Bndl) RootFS

func (b Bndl) RootFS() string

GetRootfsPath returns the path to the rootfs of this bundle. Nothing is modified

func (Bndl) Save

func (b Bndl) Save(path string) error

func (Bndl) UIDMappings

func (b Bndl) UIDMappings() []specs.LinuxIDMapping

func (Bndl) WithCPUShares

func (b Bndl) WithCPUShares(shares specs.LinuxCPU) Bndl

func (Bndl) WithCapabilities

func (b Bndl) WithCapabilities(capabilities ...string) Bndl

WithCapabilities returns a bundle with the given capabilities added. The original bundle is not modified.

func (Bndl) WithDevices

func (b Bndl) WithDevices(devices ...specs.LinuxDevice) Bndl

WithDevices returns a bundle with the given devices added. The original bundle is not modified.

func (Bndl) WithGIDMappings

func (b Bndl) WithGIDMappings(mappings ...specs.LinuxIDMapping) Bndl

func (Bndl) WithHostname

func (b Bndl) WithHostname(hostname string) Bndl

func (Bndl) WithMaskedPaths

func (b Bndl) WithMaskedPaths(maskedPaths []string) Bndl

func (Bndl) WithMemoryLimit

func (b Bndl) WithMemoryLimit(limit specs.LinuxMemory) Bndl

func (Bndl) WithMounts

func (b Bndl) WithMounts(mounts ...specs.Mount) Bndl

WithMounts returns a bundle with the given mounts added. The original bundle is not modified.

func (Bndl) WithNamespace

func (b Bndl) WithNamespace(ns specs.LinuxNamespace) Bndl

WithNamespace returns a bundle with the given namespace in the list of namespaces. The bundle is not modified, but any existing namespace of this type will be replaced.

func (Bndl) WithNamespaces

func (b Bndl) WithNamespaces(namespaces ...specs.LinuxNamespace) Bndl

WithNamespaces returns a bundle with the given namespaces. The original bundle is not modified, but the original set of namespaces is replaced in the returned bundle.

func (Bndl) WithPidLimit

func (b Bndl) WithPidLimit(limit specs.LinuxPids) Bndl

func (Bndl) WithPoststopHooks

func (b Bndl) WithPoststopHooks(hook ...specs.Hook) Bndl

func (Bndl) WithPrestartHooks

func (b Bndl) WithPrestartHooks(hook ...specs.Hook) Bndl

func (Bndl) WithProcess

func (b Bndl) WithProcess(process specs.Process) Bndl

WithProcess returns a bundle with the process replaced with the given Process. The original bundle is not modified.

func (Bndl) WithResources

func (b Bndl) WithResources(resources *specs.LinuxResources) Bndl

WithResources returns a bundle with the resources replaced with the given Resources. The original bundle is not modified.

func (Bndl) WithRootFS

func (b Bndl) WithRootFS(absolutePath string) Bndl

func (Bndl) WithUIDMappings

func (b Bndl) WithUIDMappings(mappings ...specs.LinuxIDMapping) Bndl

type BndlLoader

type BndlLoader struct {
}

func (*BndlLoader) Load

func (b *BndlLoader) Load(path string) (Bndl, error)

type NamespaceSlice

type NamespaceSlice []specs.LinuxNamespace

func (NamespaceSlice) Set

func (slice NamespaceSlice) Set(ns specs.LinuxNamespace) NamespaceSlice

type RuncBinary

type RuncBinary string

RuncBinary is the path to a runc binary.

func (RuncBinary) DeleteCommand

func (runc RuncBinary) DeleteCommand(id, logFile string) *exec.Cmd

DeleteCommand returns an *exec.Cmd that, when run, will signal the running container.

func (RuncBinary) EventsCommand

func (runc RuncBinary) EventsCommand(id string) *exec.Cmd

EventsCommand returns an *exec.Cmd that, when run, will retrieve events for the container

func (RuncBinary) ExecCommand

func (runc RuncBinary) ExecCommand(id, processJSONPath, pidFilePath string) *exec.Cmd

ExecCommand returns an *exec.Cmd that, when run, will execute a process spec in a running container.

func (RuncBinary) KillCommand

func (runc RuncBinary) KillCommand(id, signal, logFile string) *exec.Cmd

KillCommand returns an *exec.Cmd that, when run, will signal the running container.

func (RuncBinary) StartCommand

func (runc RuncBinary) StartCommand(path, id string, detach bool, log string) *exec.Cmd

StartCommand returns an *exec.Cmd that, when run, will execute a given bundle.

func (RuncBinary) StateCommand

func (runc RuncBinary) StateCommand(id, logFile string) *exec.Cmd

StateCommand returns an *exec.Cmd that, when run, will get the state of the container.

func (RuncBinary) StatsCommand

func (runc RuncBinary) StatsCommand(id, logFile string) *exec.Cmd

StatsCommand returns an *exec.Cmd that, when run, will get the stats of the container.

Jump to

Keyboard shortcuts

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