types

package
v20.10.11+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2021 License: Apache-2.0 Imports: 5 Imported by: 454

Documentation

Index

Constants

View Source
const InitProcessName = "init"

InitProcessName is the name given to the first process of a container

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	ProcessEvent(containerID string, event EventType, ei EventInfo) error
}

Backend defines callbacks that the client of the library needs to implement.

type Checkpoints

type Checkpoints struct{}

Checkpoints contains the details of a checkpoint

type Client

type Client interface {
	Version(ctx context.Context) (containerd.Version, error)

	Restore(ctx context.Context, containerID string, attachStdio StdioCallback) (alive bool, pid int, p Process, err error)

	Create(ctx context.Context, containerID string, spec *specs.Spec, shim string, runtimeOptions interface{}, opts ...containerd.NewContainerOpts) error
	Start(ctx context.Context, containerID, checkpointDir string, withStdin bool, attachStdio StdioCallback) (pid int, err error)
	SignalProcess(ctx context.Context, containerID, processID string, signal int) error
	Exec(ctx context.Context, containerID, processID string, spec *specs.Process, withStdin bool, attachStdio StdioCallback) (int, error)
	ResizeTerminal(ctx context.Context, containerID, processID string, width, height int) error
	CloseStdin(ctx context.Context, containerID, processID string) error
	Pause(ctx context.Context, containerID string) error
	Resume(ctx context.Context, containerID string) error
	Stats(ctx context.Context, containerID string) (*Stats, error)
	ListPids(ctx context.Context, containerID string) ([]uint32, error)
	Summary(ctx context.Context, containerID string) ([]Summary, error)
	DeleteTask(ctx context.Context, containerID string) (uint32, time.Time, error)
	Delete(ctx context.Context, containerID string) error
	Status(ctx context.Context, containerID string) (containerd.ProcessStatus, error)

	UpdateResources(ctx context.Context, containerID string, resources *Resources) error
	CreateCheckpoint(ctx context.Context, containerID, checkpointDir string, exit bool) error
}

Client provides access to containerd features.

type EventInfo

type EventInfo struct {
	ContainerID string
	ProcessID   string
	Pid         uint32
	ExitCode    uint32
	ExitedAt    time.Time
	OOMKilled   bool
	Error       error
}

EventInfo contains the event info

type EventType

type EventType string

EventType represents a possible event from libcontainerd

const (
	EventUnknown     EventType = "unknown"
	EventExit        EventType = "exit"
	EventOOM         EventType = "oom"
	EventCreate      EventType = "create"
	EventStart       EventType = "start"
	EventExecAdded   EventType = "exec-added"
	EventExecStarted EventType = "exec-started"
	EventPaused      EventType = "paused"
	EventResumed     EventType = "resumed"
)

Event constants used when reporting events

type Process

type Process interface {
	Delete(context.Context) (uint32, time.Time, error)
}

Process of a container

type Resources

type Resources specs.LinuxResources

Resources defines updatable container resource values. TODO: it must match containerd upcoming API

type Stats

type Stats struct {
	Read time.Time
	// Metrics is expected to be either one of:
	// * github.com/containerd/cgroups/stats/v1.Metrics
	// * github.com/containerd/cgroups/stats/v2.Metrics
	Metrics interface{}
}

Stats holds metrics properties as returned by containerd

func InterfaceToStats

func InterfaceToStats(read time.Time, v interface{}) *Stats

InterfaceToStats returns a stats object from the platform-specific interface.

type StdioCallback

type StdioCallback func(io *cio.DirectIO) (cio.IO, error)

StdioCallback is called to connect a container or process stdio.

type Summary

type Summary struct{}

Summary is not used on linux

Jump to

Keyboard shortcuts

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