docker

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2016 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerStore

type ContainerStore interface {
	AddContainerByID(id string) error
	IAMRoles() []string
	IAMRoleForIP(ip string) (string, error)
	IAMRoleForID(ip string) (string, error)
	RemoveContainer(name string)
	SyncRunningContainers() error
}

ContainerStore exposes methods to handle container lifecycle events. Instances of this interface should allow threadsafe reads and writes.

func NewContainerStore

func NewContainerStore(client RawClient) ContainerStore

NewContainerStore creates an empty container store.

type EventHandler

type EventHandler interface {
	Listen(<-chan *dockerClient.APIEvents) error
}

EventHandler instances implement DockerEventsChannel() which performs actions based on Docker events. Listen() is a blocking function which performs an action based on the events written to the channel.

func NewEventHandler

func NewEventHandler(workers int, containerStore ContainerStore, credentialStore iam.CredentialStore) EventHandler

NewEventHandler a new event handler that updates the container and IAM stores based on Docker event updates.

type RawClient

type RawClient interface {
	AddEventListener(chan<- *dockerClient.APIEvents) error
	InspectContainer(id string) (*dockerClient.Container, error)
	ListContainers(opts dockerClient.ListContainersOptions) ([]dockerClient.APIContainers, error)
}

RawClient specifies the subset of commands that EventHandlers use from the go-dockerclient.

Jump to

Keyboard shortcuts

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