package libcontainerd
import "github.com/docker/cli/components/engine/libcontainerd"
Index ¶
- Constants
- type Backend
- type Checkpoint
- type Checkpoints
- type Client
- type EventInfo
- type EventType
- type IOPipe
- func (p *IOPipe) Cancel()
- func (p *IOPipe) Close() error
- func (p *IOPipe) Config() cio.Config
- func (p *IOPipe) Wait()
- type LCOWOption
- type Remote
- type RemoteOption
- type Resources
- type ServerVersion
- type Stats
- type Status
- type StdioCallback
- type Summary
Constants ¶
const ( CoEClassstring = syscall.Errno(0x800401F3) // Invalid class string ErrorNoNetwork = syscall.Errno(1222) // The network is not present or not started ErrorBadPathname = syscall.Errno(161) // The specified path is invalid ErrorInvalidObject = syscall.Errno(0x800710D8) // The object identifier does not represent a valid object )
Win32 error codes that are used for various workarounds These really should be ALL_CAPS to match golangs syscall library and standard Win32 error conventions, but golint insists on CamelCase.
const InitProcessName = "init"
Types ¶
type Backend ¶
Backend defines callbacks that the client of the library needs to implement.
type Checkpoint ¶
type Checkpoint struct { Name string }
Checkpoint holds the details of a checkpoint (not supported in windows)
type Checkpoints ¶
type Checkpoints struct { Checkpoints []*Checkpoint }
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, err error) Create(ctx context.Context, containerID string, spec *specs.Spec, runtimeOptions interface{}) 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) (Status, 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 // Windows Only field UpdatePending bool }
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 IOPipe ¶
type IOPipe struct { Stdin io.WriteCloser Stdout io.ReadCloser Stderr io.ReadCloser Terminal bool // Whether stderr is connected on Windows // contains filtered or unexported fields }
IOPipe contains the stdio streams.
func (*IOPipe) Cancel ¶
func (p *IOPipe) Cancel()
Cancel aborts ongoing operations if they have not completed yet
func (*IOPipe) Close ¶
Close closes the underlying pipes
func (*IOPipe) Config ¶
Config returns the containerd.IOConfig of this pipe set
func (*IOPipe) Wait ¶
func (p *IOPipe) Wait()
Wait waits for io operations to finish
type LCOWOption ¶
LCOWOption is a CreateOption required for LCOW configuration
func (*LCOWOption) Apply ¶
func (s *LCOWOption) Apply(interface{}) error
Apply for the LCOW option is a no-op.
type Remote ¶
type Remote interface { // Client returns a new Client instance connected with given Backend. NewClient(namespace string, backend Backend) (Client, error) // Cleanup stops containerd if it was started by libcontainerd. // Note this is not used on Windows as there is no remote containerd. Cleanup() }
Remote on Linux defines the accesspoint to the containerd grpc API. Remote on Windows is largely an unimplemented interface as there is no remote containerd.
func New ¶
func New(rootDir, stateDir string, options ...RemoteOption) (Remote, error)
New creates a fresh instance of libcontainerd remote.
type RemoteOption ¶
RemoteOption allows to configure parameters of remotes. This is unused on Windows.
type Resources ¶
type Resources struct{}
Resources defines updatable container resource values.
type ServerVersion ¶
type ServerVersion struct { }
ServerVersion contains version information as retrieved from the server
type Stats ¶
type Stats struct { Read time.Time HCSStats *hcsshim.Statistics }
Stats contains statistics from HCS
type Status ¶
type Status string
Status represents the current status of a container
const ( // Running indicates the process is currently executing StatusRunning Status = "running" // Created indicates the process has been created within containerd but the // user's defined process has not started StatusCreated Status = "created" // Stopped indicates that the process has ran and exited StatusStopped Status = "stopped" // Paused indicates that the process is currently paused StatusPaused Status = "paused" // Pausing indicates that the process is currently switching from a // running state into a paused state StatusPausing Status = "pausing" // Unknown indicates that we could not determine the status from the runtime StatusUnknown Status = "unknown" )
Possible container statuses
type StdioCallback ¶
StdioCallback is called to connect a container or process stdio.
type Summary ¶
type Summary hcsshim.ProcessListItem
Summary contains a ProcessList item from HCS to support `top`
Source Files ¶
client_daemon_windows.go client_local_windows.go errors.go io.go io_windows.go process_windows.go queue.go remote_local.go types.go types_windows.go utils_windows.go
- Version
- v17.12.0-ce+incompatible
- Published
- Dec 27, 2017
- Platform
- windows/amd64
- Imports
- 28 packages
- Last checked
- 3 minutes ago –
Tools for package owners.