discovery

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerClient added in v1.1.0

type DockerClient interface {
	ListContainers(opts docker.ListContainersOptions) ([]docker.APIContainers, error)
	AddEventListener(listener chan<- *docker.APIEvents) error
}

DockerClient defines interface listing containers and subscribing to events

type Event

type Event struct {
	ContainerID   string
	ContainerName string
	Group         string // group is the "path" part of the image tag, i.e. for umputun/system/logger:latest it will be "system"
	TS            time.Time
	Status        bool
}

Event is simplified docker.APIEvents for containers only, exposed to caller

type EventNotif

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

EventNotif emits all changes from all containers states

func NewEventNotif

func NewEventNotif(dockerClient DockerClient, excludes, includes []string, includesPattern string) (*EventNotif, error)

NewEventNotif makes EventNotif publishing all changes to eventsCh

func (*EventNotif) Channel

func (e *EventNotif) Channel() (res <-chan Event)

Channel gets eventsCh with all containers events

Jump to

Keyboard shortcuts

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