engineclient

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2021 License: Apache-2.0 Imports: 2 Imported by: 2

Documentation

Overview

Package engineclient provides container engine-specific EngineClient implementations in its sub-packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerEvent

type ContainerEvent struct {
	Born    bool   // true if new container, false if container has died.
	ID      string // ID (or name) of container.
	Project string // optional composer project name, or zero.
}

ContainerEvent is either a container lifecycle event of a container becoming alive or having died.

type EngineClient

type EngineClient interface {
	// List for the currently alive and kicking containers.
	List(ctx context.Context) ([]*whalewatcher.Container, error)
	// Query (only) those container details of interest to us, given the name or
	// ID of a container.
	Inspect(ctx context.Context, nameorid string) (*whalewatcher.Container, error)
	// Stream container lifecycle events, limited to those events in the
	// lifecycle of containers getting born (=alive, as opposed to, say,
	// "conceived") and die.
	LifecycleEvents(ctx context.Context) (<-chan ContainerEvent, <-chan error)

	// (More or less) unique engine identifier; the exact format is
	// engine-specific.
	ID(ctx context.Context) string

	// Clean up and release any engine client resources, if necessary.
	Close()
}

EngineClient defines the generic methods needed in order to watch the containers of a container engine, regardless of the specific type of engine.

Directories

Path Synopsis
Package containerd implements the containerd EngineClient.
Package containerd implements the containerd EngineClient.
Package moby implements the Docker/Moby EngineClient.
Package moby implements the Docker/Moby EngineClient.

Jump to

Keyboard shortcuts

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