docker

package
v4.2.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindHostMappedPort

func FindHostMappedPort(cont *dtypes.ContainerJSON, exposedPort nat.Port) (int, string)

FindHostMappedPort returns the port number of the docker port binding to the underlying host, or 0 if none exists. It also returns the mapped ip that the port is bound to on the underlying host, or "" if none exists.

func ListAndWatchContainers

func ListAndWatchContainers(ctx context.Context, client *docker.Client, changeHandler ContainerChangeHandler, imageFilter filter.StringFilter, logger log.FieldLogger) error

ListAndWatchContainers accepts a changeHandler that gets called as containers come and go.

Types

type ContainerChangeHandler

type ContainerChangeHandler func(old *dtypes.ContainerJSON, new *dtypes.ContainerJSON)

ContainerChangeHandler is what gets called when a Docker container is initially recognized or changed in some way. old will be the previous state, or nil if no previous state is known. new is the new state, or nil if the container is being destroyed.

Jump to

Keyboard shortcuts

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