runtime

package
v0.0.0-...-d12d6dc Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package runtime defines the interface between the GCS and an OCI container runtime.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerProcessState

type ContainerProcessState struct {
	Pid              int
	Command          []string
	CreatedByRuntime bool
	IsZombie         bool
}

ContainerProcessState gives information about a process created by a Runtime.

type ContainerState

type ContainerState struct {
	OCIVersion string
	ID         string
	Pid        int
	BundlePath string
	RootfsPath string
	Status     string
	Created    string
}

ContainerState gives information about a container created by a Runtime.

type Runtime

type Runtime interface {
	CreateContainer(id string, bundlePath string, stdioOptions StdioOptions) (pid int, err error)
	StartContainer(id string) error
	ExecProcess(id string, process oci.Process, stdioOptions StdioOptions) (pid int, err error)
	KillContainer(id string, signal oslayer.Signal) error
	DeleteContainer(id string) error
	DeleteProcess(id string, pid int) error
	PauseContainer(id string) error
	ResumeContainer(id string) error
	GetContainerState(id string) (*ContainerState, error)
	ContainerExists(id string) (bool, error)
	ListContainerStates() ([]ContainerState, error)
	GetRunningContainerProcesses(id string) ([]ContainerProcessState, error)
	GetAllContainerProcesses(id string) ([]ContainerProcessState, error)
	WaitOnProcess(id string, pid int) (oslayer.ProcessExitState, error)
	WaitOnContainer(id string) (oslayer.ProcessExitState, error)

	GetInitPid(id string) (pid int, err error)
	GetStdioPipes(id string, pid int) (*StdioPipes, error)
}

Runtime is the interface defining commands over an OCI container runtime, such as runC.

type StdioOptions

type StdioOptions struct {
	CreateIn  bool
	CreateOut bool
	CreateErr bool
}

StdioOptions specify how the runtime should handle stdio for the process.

type StdioPipes

type StdioPipes struct {
	In  io.WriteCloser
	Out io.ReadCloser
	Err io.ReadCloser
}

StdioPipes contain the interfaces for reading from and writing to a process's stdio.

Directories

Path Synopsis
Package mockruntime defines a mock implementation of the Runtime interface.
Package mockruntime defines a mock implementation of the Runtime interface.
Package runc defines an implementation of the Runtime interface which uses runC as the container runtime.
Package runc defines an implementation of the Runtime interface which uses runC as the container runtime.

Jump to

Keyboard shortcuts

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