Documentation ¶
Overview ¶
Package testing aims to provide simple "helper" methods to ease the use of docker in (integration) tests using the testing built-in package.
It does support a subset of options compared to actual client api, as it is more focused on needs for integration tests.
Index ¶
- type Project
- func (p *Project) Clean(t *testing.T, keep bool)
- func (p *Project) Create(t *testing.T, image string) types.ContainerJSON
- func (p *Project) CreateWithConfig(t *testing.T, image string, containerConfig docker.ContainerConfig) types.ContainerJSON
- func (p *Project) Inspect(t *testing.T, containerID string) types.ContainerJSON
- func (p *Project) IsPaused(t *testing.T, containerID string) bool
- func (p *Project) IsRunning(t *testing.T, containerID string) bool
- func (p *Project) IsStopped(t *testing.T, containerID string) bool
- func (p *Project) List(t *testing.T) []types.Container
- func (p *Project) Pull(t *testing.T, ref string)
- func (p *Project) Remove(t *testing.T, containerID string)
- func (p *Project) Start(t *testing.T, image string) types.ContainerJSON
- func (p *Project) StartWithConfig(t *testing.T, image string, containerConfig docker.ContainerConfig) types.ContainerJSON
- func (p *Project) Stop(t *testing.T, containerID string)
- func (p *Project) StopWithTimeout(t *testing.T, containerID string, timeout int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Project ¶
type Project struct {
// contains filtered or unexported fields
}
Project holds docker related project attributes, like docker client, labels to put on the containers, and so on.
func NewProject ¶
NewProject creates a project with the given client and the default attributes.
func NewProjectFromEnv ¶
NewProjectFromEnv creates a project with a client that is build from environment variables.
func (*Project) Clean ¶
Clean stops and removes (by default, controllable with the keep) kermit containers
func (*Project) Create ¶
Create lets you create a container with the specified image, and default configuration.
func (*Project) CreateWithConfig ¶
func (p *Project) CreateWithConfig(t *testing.T, image string, containerConfig docker.ContainerConfig) types.ContainerJSON
CreateWithConfig lets you create a container with the specified image, and some custom simple configuration.
func (*Project) Start ¶
Start lets you create and start a container with the specified image, and default configuration.
func (*Project) StartWithConfig ¶
func (p *Project) StartWithConfig(t *testing.T, image string, containerConfig docker.ContainerConfig) types.ContainerJSON
StartWithConfig lets you create and start a container with the specified image, and some custom simple configuration.