visitor

package
v1.7.5 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2022 License: BSD-3-Clause Imports: 10 Imported by: 5

Documentation

Index

Constants

View Source
const (
	START     = "start" // Container action
	STOP      = "stop"  // Container action
	DIE       = "die"   // Container action
	DESTROY   = "destroy"
	CONTAINER = "container"
	EVENT     = "event"
)

Variables

View Source
var (
	// DockerTries is the number of retries
	DockerTries = 12
)

Functions

func PingDocker

func PingDocker(_client *client.Client) error

PingDocker ping Docker, try 12 times, wait 5s

Types

type Watcher

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

func New

func New(client *client.Client) *Watcher

New Watcher, from a Docker client

func (*Watcher) Container added in v0.1.2

func (w *Watcher) Container(id string) *types.ContainerJSON

func (*Watcher) Find added in v0.1.3

func (w *Watcher) Find(visitor func(*types.ContainerJSON) (bool, error)) ([]*types.ContainerJSON, error)

func (*Watcher) Ready added in v0.1.4

func (w *Watcher) Ready()

Ready when already here containers are known

func (*Watcher) Start

func (w *Watcher) Start(ctx context.Context) error

Start watching Docker events

func (*Watcher) VisitCurrentCointainer added in v0.1.1

func (w *Watcher) VisitCurrentCointainer(visitor func(container *types.ContainerJSON) error)

VisitCurrentCointainer visit already present containers

func (*Watcher) WatchFor

func (w *Watcher) WatchFor(visitor func(action string, container *types.ContainerJSON), labels ...string)

WatchFor visitor function and label names

Jump to

Keyboard shortcuts

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