Documentation ¶
Index ¶
- Constants
- func NewClient() (*ispDockerClient, error)
- type ContainerContext
- func (ctx *ContainerContext) Close() error
- func (ctx *ContainerContext) ForceRemoveContainer() error
- func (ctx *ContainerContext) ForceRemoveImage() error
- func (ctx *ContainerContext) GetIPAddress() string
- func (ctx *ContainerContext) StartContainer() error
- func (ctx *ContainerContext) StopContainer(timeout time.Duration) error
- type NetworkContext
- type Option
- func PullImage(registryLogin string, registryPassword string) Option
- func WithCustomImage(image string) Option
- func WithEnv(vars map[string]string) Option
- func WithLogger(logger io.Writer) Option
- func WithName(containerName string) Option
- func WithNetwork(ctx *NetworkContext) Option
- func WithPortBindings(mapping map[string]string) Option
- func WithVolumes(volume map[string]string) Option
- type TestEnvironment
- func (te *TestEnvironment) Cleanup() error
- func (te *TestEnvironment) Network() *NetworkContext
- func (te *TestEnvironment) RunAppContainer(image string, localConfig interface{}, remoteConfig interface{}, ...) *ContainerContext
- func (te *TestEnvironment) RunConfigServiceContainer(opts ...Option) (*ContainerContext, structure.AddressConfiguration)
- func (te *TestEnvironment) RunElasticContainer(opts ...Option) (*ContainerContext, structure.ElasticConfiguration)
- func (te *TestEnvironment) RunPGContainer(opts ...Option) (*ContainerContext, structure.DBConfiguration)
- func (te *TestEnvironment) RunRabbitContainer(opts ...Option) (*ContainerContext, mq.Config)
Constants ¶
View Source
const ( DefaultPGImage = "docker.io/library/postgres:alpine" DefaultRabbitImage = "docker.io/library/rabbitmq:alpine" DefaultElasticImage = "docker.io/library/elasticsearch:6.8.4" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ContainerContext ¶
type ContainerContext struct {
// contains filtered or unexported fields
}
func (*ContainerContext) Close ¶
func (ctx *ContainerContext) Close() error
force delete container and image
func (*ContainerContext) ForceRemoveContainer ¶
func (ctx *ContainerContext) ForceRemoveContainer() error
func (*ContainerContext) ForceRemoveImage ¶
func (ctx *ContainerContext) ForceRemoveImage() error
func (*ContainerContext) GetIPAddress ¶ added in v1.1.0
func (ctx *ContainerContext) GetIPAddress() string
func (*ContainerContext) StartContainer ¶ added in v1.3.0
func (ctx *ContainerContext) StartContainer() error
StartContainer sends a request to the docker daemon to start a container.
func (*ContainerContext) StopContainer ¶ added in v1.3.0
func (ctx *ContainerContext) StopContainer(timeout time.Duration) error
StopContainer stops a container without terminating the process. The process is blocked until the container stops or the timeout expires.
type NetworkContext ¶
type NetworkContext struct {
// contains filtered or unexported fields
}
func (*NetworkContext) Close ¶
func (ctx *NetworkContext) Close() error
type Option ¶
type Option func(opts *options)
func WithCustomImage ¶ added in v1.1.0
func WithNetwork ¶
func WithNetwork(ctx *NetworkContext) Option
if set, container joins to specified network
func WithPortBindings ¶
bind ports host_machine_port -> container_exposed_port
func WithVolumes ¶ added in v1.0.1
type TestEnvironment ¶ added in v1.1.0
type TestEnvironment struct {
// contains filtered or unexported fields
}
func NewTestEnvironment ¶ added in v1.1.0
func NewTestEnvironment(testCtx *ctx.TestContext, cli *ispDockerClient) *TestEnvironment
func (*TestEnvironment) Cleanup ¶ added in v1.1.0
func (te *TestEnvironment) Cleanup() error
func (*TestEnvironment) Network ¶ added in v1.1.0
func (te *TestEnvironment) Network() *NetworkContext
func (*TestEnvironment) RunAppContainer ¶ added in v1.1.0
func (te *TestEnvironment) RunAppContainer(image string, localConfig interface{}, remoteConfig interface{}, opts ...Option) *ContainerContext
func (*TestEnvironment) RunConfigServiceContainer ¶ added in v1.1.0
func (te *TestEnvironment) RunConfigServiceContainer(opts ...Option) (*ContainerContext, structure.AddressConfiguration)
func (*TestEnvironment) RunElasticContainer ¶ added in v1.1.0
func (te *TestEnvironment) RunElasticContainer(opts ...Option) (*ContainerContext, structure.ElasticConfiguration)
func (*TestEnvironment) RunPGContainer ¶ added in v1.1.0
func (te *TestEnvironment) RunPGContainer(opts ...Option) (*ContainerContext, structure.DBConfiguration)
func (*TestEnvironment) RunRabbitContainer ¶ added in v1.1.0
func (te *TestEnvironment) RunRabbitContainer(opts ...Option) (*ContainerContext, mq.Config)
Click to show internal directories.
Click to hide internal directories.