moby

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: 7 Imported by: 12

Documentation

Overview

Package moby implements the Docker/Moby EngineClient.

Index

Constants

View Source
const ComposerProjectLabel = "com.docker.compose.project"

ComposerProjectLabel is the name of an optional container label identifying the composer project a container is part of.

Variables

This section is empty.

Functions

This section is empty.

Types

type MobyAPIClient

type MobyAPIClient interface {
	client.ContainerAPIClient
	client.SystemAPIClient
	Close() error
}

MobyAPIClient is a Docker client offering the container and system APIs. For production, Docker's client.Client is a compatible implementation, for unit testing our very own mockingmoby.MockingMoby.

type MobyWatcher

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

MobyWatcher is a Docker-engine EngineClient for interfacing the generic whale watching with Docker daemons.

func NewMobyWatcher

func NewMobyWatcher(moby MobyAPIClient) *MobyWatcher

NewMobyWatcher returns a new MobyWatcher using the specified Docker engine client; normally, you would want to use this lower-level constructor only in unit tests.

func (*MobyWatcher) Close

func (mw *MobyWatcher) Close()

Close cleans up and release any engine client resources, if necessary.

func (*MobyWatcher) ID

func (mw *MobyWatcher) ID(ctx context.Context) string

ID returns the (more or less) unique engine identifier; the exact format is engine-specific.

func (*MobyWatcher) Inspect

func (mw *MobyWatcher) Inspect(ctx context.Context, nameorid string) (*whalewatcher.Container, error)

Inspect (only) those container details of interest to us, given the name or ID of a container.

func (*MobyWatcher) LifecycleEvents

func (mw *MobyWatcher) LifecycleEvents(ctx context.Context) (<-chan engineclient.ContainerEvent, <-chan error)

LifecycleEvents streams container engine events, limited just to those events in the lifecycle of containers getting born (=alive, as opposed to, say, "conceived") and die.

func (*MobyWatcher) List

func (mw *MobyWatcher) List(ctx context.Context) ([]*whalewatcher.Container, error)

List all the currently alive and kicking containers, but do not list any containers without any processes.

Jump to

Keyboard shortcuts

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