docker

package
v0.0.0-...-3dd6856 Latest Latest
Warning

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

Go to latest
Published: May 20, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DockerEntityPrefix is the entity prefix for docker containers
	DockerEntityPrefix = "docker://"
)

Variables

View Source
var (
	ErrAlreadySubscribed = errors.New("already subscribed")
	ErrNotSubscribed     = errors.New("not subscribed")
	ErrEventTimeout      = errors.New("timeout on event sending, re-subscribe")
)

Errors client might receive

View Source
var (
	// ErrNotImplemented is the "not implemented" error given by `gopsutil` when an
	// OS doesn't support and API. Unfortunately it's in an internal package so
	// we can't import it so we'll copy it here.
	ErrNotImplemented = errors.New("not implemented yet")

	// ErrDockerNotAvailable is returned if Docker is not running on the current machine.
	// We'll use this when configuring the DockerUtil so we don't error on non-docker machines.
	ErrDockerNotAvailable = errors.New("docker not available")

	// ErrDockerNotCompiled is returned if docker support is not compiled in.
	// User classes should handle that case as gracefully as possible.
	ErrDockerNotCompiled = errors.New("docker support not compiled in")
)

Functions

func ContainerIDToEntityName

func ContainerIDToEntityName(cid string) string

ContainerIDToEntityName returns a prefixed entity name from a container ID

func FindRancherIPInLabels

func FindRancherIPInLabels(labels map[string]string) (string, bool)

FindRancherIPInLabels looks for the `io.rancher.container.ip` label and parses it. Rancher 1.x containers don't have docker networks as the orchestrator provides its own CNI.

func GetTags

func GetTags() ([]string, error)

GetTags returns tags that are automatically added to metrics and events on a host that is running docker.

func HostnameProvider

func HostnameProvider() (string, error)

HostnameProvider docker implementation for the hostname provider

Types

type ContainerEvent

type ContainerEvent struct {
	ContainerID   string
	ContainerName string
	ImageName     string
	Action        string
	Timestamp     time.Time
	Attributes    map[string]string
}

ContainerEvent describes an event from the docker daemon

func (*ContainerEvent) ContainerEntityName

func (ev *ContainerEvent) ContainerEntityName() string

ContainerEntityName returns the event's container as a tagger entity name

Jump to

Keyboard shortcuts

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