docker

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NetworkConnect

func NetworkConnect(t *testing.T, network string, containerID string)

NetworkConnect connects a container to the given network.

Types

type Container

type Container struct {
	ID           string
	ExposedPorts map[string][]Port // the map keys are the exposed container ports
	Volumes      []string
	// contains filtered or unexported fields
}

Container represents a docker container and holds the information for communicating with the running docker container.

func StartLocalStackContainer

func StartLocalStackContainer(t *testing.T, envars map[string]string, tmpDirVolume string) *Container

StartLocalStackContainer spins up a localstack container to mock aws services, provide configuration with envars and give a temp directory for to bind the container /tmp/localstack directory to.

func (*Container) Cleanup

func (c *Container) Cleanup()

Cleanup stops and removes the container, it also removes any volumes created by the container. This should be called after for every creation of a container to avoid leaking system resources.

func (*Container) Logs

func (c *Container) Logs() string

Logs outputs the logs produced by the container.

type Port

type Port struct {
	HostIP   string `json:"HostIp"`
	HostPort string `json:"HostPort"`
}

Jump to

Keyboard shortcuts

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