containersync

package
v0.0.0-...-35c2a2b Latest Latest
Warning

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

Go to latest
Published: May 19, 2017 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerSyncWorker

type ContainerSyncWorker struct {
	Config       *config.DevicedConfig
	ConfigLock   *sync.Mutex
	WorkerLock   *sync.Mutex
	DockerClient *dc.Client
	Reflection   *reflection.DevicedReflection

	EventsContext       context.Context
	EventsContextCancel context.CancelFunc
	Running             bool

	EventsChannel <-chan dce.Message
	ErrorsChannel <-chan error
	WakeChannel   chan bool
}
Container Sync Worker

This worker periodically compares the list of target containers, the list of running containers, and attempts to reconcile by deleting / creating.

It also checks the list of available images to see if a better version for a container is available.

If so it will delete the old container and make a new one with the new version.

The worker uses the Docker events API to wait for events.

Waking the worker can be done by sending

func (*ContainerSyncWorker) Init

func (cw *ContainerSyncWorker) Init() error

Init the worker

func (*ContainerSyncWorker) Quit

func (cw *ContainerSyncWorker) Quit()

func (*ContainerSyncWorker) Run

func (cw *ContainerSyncWorker) Run()

Jump to

Keyboard shortcuts

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