container

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2019 License: Apache-2.0 Imports: 17 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func And added in v1.3.0

func And(a func(container *docker.APIContainers) bool, b func(container *docker.APIContainers) bool) func(container *docker.APIContainers) bool

And returns a container matching function composed of and'ing its argument funcs

func Attach added in v1.3.0

func Attach(c docker.APIContainers, stdout, stderr chan<- []byte, stdin <-chan []byte) error

Attach to a container

func GetAvailableHostPort

func GetAvailableHostPort() int

GetAvailableHostPort returns an available (and random) port on the host machine

func Kill

func Kill(matcher func(container *docker.APIContainers) bool, removeContainer, destroyData bool) error

Kill the container with the given name and optionally remove mounted volumes.

func List

func List(client *docker.Client, matches func(container *docker.APIContainers) bool, all bool) ([]docker.APIContainers, error)

List containers matching the given predicate.

func LoadFiles added in v1.3.0

func LoadFiles(dir string, files map[string][]byte) error

LoadFiles will load the given files into the dir for container usage

func Or added in v1.3.0

func Or(a func(container *docker.APIContainers) bool, b func(container *docker.APIContainers) bool) func(container *docker.APIContainers) bool

Or returns a container matching function composed of or'ing its argument funcs

func RunDaemonized

func RunDaemonized(name, repository, tag string, ports map[int]int, files map[string][]byte, labels map[string]string, restart bool, stdout, stderr chan<- []byte, done chan<- bool) (*docker.Container, error)

RunDaemonized will pull, create and start the container piping stdout and stderr to the given channels. This function is meant to run longlived, persistent processes. A directory (/<name>) will be mounted in the container in which data which must be persisted between sessions can be kept.

func RunLambda

func RunLambda(ctx context.Context, name, repository, tag string, mounts map[string]string) ([]byte, []byte, error)

RunLambda will pull, create and start the container returning its stdout. This function is meant to run a shortlived process.

func WithID added in v1.3.0

func WithID(id string) func(container *docker.APIContainers) bool

WithID returns a func to match a containers ID (for use with e.g. List)

func WithLabel

func WithLabel(label, value string) func(container *docker.APIContainers) bool

WithLabel returns a func to match containers based on their label (for use with e.g. List)

func WithName

func WithName(name string) func(container *docker.APIContainers) bool

WithName returns a func to match a containers name (for use with e.g. List)

func WithState added in v1.4.0

func WithState(state string) func(container *docker.APIContainers) bool

WithState returns a func to match a container's state (for use with e.g. List)

Types

This section is empty.

Jump to

Keyboard shortcuts

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