dockermonitor

package
v1.0.30 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2017 License: GPL-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDockerMonitor

func NewDockerMonitor(
	socketType string,
	socketAddress string,
	p monitor.ProcessingUnitsHandler,
	m DockerMetadataExtractor,
	l collector.EventCollector,
	syncAtStart bool,
	s monitor.SynchronizationHandler,
	killContainerOnPolicyError bool,
) monitor.Monitor

NewDockerMonitor returns a pointer to a DockerMonitor initialized with the given socketType ('tcp' or 'unix') and socketAddress (a port for 'tcp' or a socket file for 'unix').

After creating a new DockerMonitor, call addHandler to install one or more callback handlers for the events to monitor. Then call Start.

Types

type DockerEvent

type DockerEvent string

DockerEvent is the type of various docker events.

const (
	// DockerEventCreate represents the Docker "create" event.
	DockerEventCreate DockerEvent = "create"

	// DockerEventStart represents the Docker "start" event.
	DockerEventStart DockerEvent = "start"

	// DockerEventDie represents the Docker "die" event.
	DockerEventDie DockerEvent = "die"

	// DockerEventDestroy represents the Docker "destroy" event.
	DockerEventDestroy DockerEvent = "destroy"

	// DockerEventPause represents the Docker "destroy" event.
	DockerEventPause DockerEvent = "pause"

	// DockerEventUnpause represents the Docker "destroy" event.
	DockerEventUnpause DockerEvent = "unpause"

	// DockerEventConnect represents the Docker "connect" event.
	DockerEventConnect DockerEvent = "connect"

	// DockerClientVersion is the version sent out as the client
	DockerClientVersion = "v1.23"

	// DockerHostMode is the string of the network mode that indicates a host namespace
	DockerHostMode = "host"
)

type DockerEventHandler

type DockerEventHandler func(event *events.Message) error

A DockerEventHandler is type of docker event handler functions.

type DockerMetadataExtractor

type DockerMetadataExtractor func(*types.ContainerJSON) (*policy.PURuntime, error)

A DockerMetadataExtractor is a function used to extract a *policy.PURuntime from a given docker ContainerJSON.

Jump to

Keyboard shortcuts

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