docker

package
v0.0.0-...-95a4de8 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2019 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action string

Action of the container

const (
	Start Action = "start"
	Die   Action = "die"
)

actions

type Cli

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

Cli with docker

func New

func New(ctx context.Context) (*Cli, error)

New docker cli

func (*Cli) Containers

func (c *Cli) Containers() chan ContainerSpec

Containers channel

func (*Cli) ListContainers

func (c *Cli) ListContainers() error

ListContainers and put into container channel

func (*Cli) PullImage

func (c *Cli) PullImage(ctx context.Context, image string) error

func (*Cli) ReCreate

func (c *Cli) ReCreate(ctx context.Context, cid string) error

ReCreate a container

func (*Cli) WatchEvents

func (c *Cli) WatchEvents() error

WatchEvents (start and die)

func (*Cli) WatchImageChange

func (c *Cli) WatchImageChange(ctx context.Context, image string) (<-chan string, error)

type Config

type Config struct {
	Path    string            // docker sock path
	Filters map[string]string // docker ls filters
}

Config ...

type ContainerSpec

type ContainerSpec struct {
	ID     string
	Image  string
	Action Action
}

ContainerSpec the infomation of the container

Jump to

Keyboard shortcuts

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