Documentation ¶
Index ¶
- func And(a func(container *docker.APIContainers) bool, ...) func(container *docker.APIContainers) bool
- func Attach(c docker.APIContainers, stdout, stderr chan<- []byte, stdin <-chan []byte) error
- func GetAvailableHostPort() int
- func Kill(matcher func(container *docker.APIContainers) bool, ...) error
- func List(client *docker.Client, matches func(container *docker.APIContainers) bool, ...) ([]docker.APIContainers, error)
- func LoadFiles(dir string, files map[string][]byte) error
- func Or(a func(container *docker.APIContainers) bool, ...) func(container *docker.APIContainers) bool
- func RunDaemonized(name, repository, tag string, ports map[int]int, files map[string][]byte, ...) (*docker.Container, error)
- func RunLambda(ctx context.Context, name, repository, tag string, mounts map[string]string) ([]byte, []byte, error)
- func WithID(id string) func(container *docker.APIContainers) bool
- func WithLabel(label, value string) func(container *docker.APIContainers) bool
- func WithName(name string) func(container *docker.APIContainers) bool
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
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)
Types ¶
This section is empty.