Documentation
¶
Overview ¶
Package docker aims to provide simple "helper" methods to ease the use of docker in (integration) tests using the go-check testing 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(c *check.C, keep bool)
- func (p *Project) Create(c *check.C, image string) types.ContainerJSON
- func (p *Project) CreateWithConfig(c *check.C, image string, containerConfig docker.ContainerConfig) types.ContainerJSON
- func (p *Project) Inspect(c *check.C, containerID string) types.ContainerJSON
- func (p *Project) IsPaused(c *check.C, containerID string) bool
- func (p *Project) IsRunning(c *check.C, containerID string) bool
- func (p *Project) IsStopped(c *check.C, containerID string) bool
- func (p *Project) List(c *check.C) []types.Container
- func (p *Project) Pull(c *check.C, ref string)
- func (p *Project) Remove(c *check.C, containerID string)
- func (p *Project) Start(c *check.C, image string) types.ContainerJSON
- func (p *Project) StartWithConfig(c *check.C, image string, containerConfig docker.ContainerConfig) types.ContainerJSON
- func (p *Project) Stop(c *check.C, containerID string)
- func (p *Project) StopWithTimeout(c *check.C, 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(c *check.C, 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(c *check.C, image string, containerConfig docker.ContainerConfig) types.ContainerJSON
StartWithConfig lets you create and start a container with the specified image, and some custom simple configuration.