Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindHostMappedPort ¶
func FindHostMappedPort(cont *dtypes.ContainerJSON, exposedPort nat.Port) int
FindHostMappedPort returns the port number of the docker port binding to the underlying host, or 0 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.
Click to show internal directories.
Click to hide internal directories.