docker

package
v0.0.0-...-474187c Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Host   string
	Events chan<- *container.Container
}

Config stores configuration information for connecting to the Docker daemon.

type Monitor

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

Monitor connects to the Docker daemon and watches for containers being started and stopped. The monitor sends on the Event channel when containers with the appropriate labels are started and stopped.

func New

func New(cfg *Config) (*Monitor, error)

New creates a new monitor from the specified config. Use the Close method to shut down the monitor.

func (*Monitor) Close

func (m *Monitor) Close()

Close shuts down the monitor.

func (*Monitor) Restart

func (m *Monitor) Restart(ctx context.Context, id string) error

Restart attempts to restart the specified container.

Jump to

Keyboard shortcuts

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