libcontainerd

package
v6.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(addr, namespace string, requestTimeout time.Duration) *client

Types

type Client

type Client interface {

	// Init provides the initialization of internal structures necessary by
	// the client, e.g., instantiation of the gRPC client.
	//
	Init() (err error)

	// Version queries containerd's version service in order to verify
	// connectivity.
	//
	Version(ctx context.Context) (err error)

	// Stop deallocates any initialization performed by `Init()` and
	// subsequent calls to methods of this interface.
	//
	Stop() (err error)

	// NewContainer creates a container in containerd.
	//
	NewContainer(
		ctx context.Context,
		id string,
		labels map[string]string,
		oci *specs.Spec,
	) (
		container containerd.Container, err error,
	)

	// Containers lists containers available in containerd matching a given
	// labelset.
	//
	Containers(
		ctx context.Context,
		labels ...string,
	) (
		containers []containerd.Container, err error,
	)

	// GetContainer retrieves a created container that matches the specified handle.
	//
	GetContainer(
		ctx context.Context,
		handle string,
	) (
		container containerd.Container, err error,
	)

	// Destroy stops any running tasks on a container and removes the container.
	// If a task cannot be stopped gracefully, it will be forcefully stopped after
	// a timeout period (default 10 seconds).
	//
	Destroy(ctx context.Context, handle string) error
}

Client represents the minimum interface used to communicate with containerd to manage containers.

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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