Help us shape the future of Go! Take the 2026 Go Developer Survey

client

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerState

type ContainerState struct {
	// ID is the container ID
	ID string `json:"id"`
	// InitProcessPid is the init process id in the parent namespace
	InitProcessPid int `json:"pid"`
	// Status is the current status of the container, running, paused, ...
	Status string `json:"status"`
}

https://github.com/opencontainers/runc/blob/master/list.go#L24-L45

type RuncClient

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

func NewRuncClient

func NewRuncClient(runcPath, runcRoot string, inSystemd bool) *RuncClient

func (*RuncClient) ContainerState

func (c *RuncClient) ContainerState(containerID string) (*specs.State, error)

ContainerState returns the following:

  • state, nil if the job is running,and no errors were encountered.
  • nil,nil if the container state is not running and no other errors were encountered
  • nil,error if there is any other error getting the container state (e.g. the container is running but in an unreachable state)

func (*RuncClient) CreateBundle

func (*RuncClient) CreateBundle(
	bundlePath string,
	jobSpec specs.Spec,
	user specs.User,
) error

func (*RuncClient) DeleteContainer

func (c *RuncClient) DeleteContainer(containerID string) error

func (*RuncClient) DestroyBundle

func (*RuncClient) DestroyBundle(bundlePath string) error

func (*RuncClient) Exec

func (c *RuncClient) Exec(containerID, command string, stdin io.Reader, stdout, stderr io.Writer) error

Exec assumes you are launching an interactive shell. We should improve the interface to mirror `runc exec` more generally.

func (*RuncClient) ListContainers

func (c *RuncClient) ListContainers() ([]ContainerState, error)

func (*RuncClient) RunContainer

func (c *RuncClient) RunContainer(pidFilePath, bundlePath, containerID string, detach bool, stdout, stderr io.Writer) (int, error)

func (*RuncClient) SignalContainer

func (c *RuncClient) SignalContainer(containerID string, signal Signal) error

type Signal

type Signal int
const (
	Term Signal = iota
	Quit
)

func (Signal) String

func (s Signal) String() string

Jump to

Keyboard shortcuts

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