Documentation ¶
Index ¶
- func ForSQL(port nat.Port, driver string, url func(host string, port nat.Port) string) *waitForSql
- type ExecStrategy
- func (ws *ExecStrategy) Timeout() *time.Duration
- func (ws *ExecStrategy) WaitUntilReady(ctx context.Context, target StrategyTarget) error
- func (ws *ExecStrategy) WithExitCode(exitCode int) *ExecStrategy
- func (ws *ExecStrategy) WithExitCodeMatcher(exitCodeMatcher func(exitCode int) bool) *ExecStrategy
- func (ws *ExecStrategy) WithPollInterval(pollInterval time.Duration) *ExecStrategy
- func (ws *ExecStrategy) WithResponseMatcher(matcher func(body io.Reader) bool) *ExecStrategy
- func (ws *ExecStrategy) WithStartupTimeout(startupTimeout time.Duration) *ExecStrategy
- type ExitStrategy
- func (ws *ExitStrategy) Timeout() *time.Duration
- func (ws *ExitStrategy) WaitUntilReady(ctx context.Context, target StrategyTarget) error
- func (ws *ExitStrategy) WithExitTimeout(exitTimeout time.Duration) *ExitStrategy
- func (ws *ExitStrategy) WithPollInterval(pollInterval time.Duration) *ExitStrategy
- type HTTPStrategy
- func (ws *HTTPStrategy) Timeout() *time.Duration
- func (ws *HTTPStrategy) WaitUntilReady(ctx context.Context, target StrategyTarget) error
- func (ws *HTTPStrategy) WithAllowInsecure(allowInsecure bool) *HTTPStrategy
- func (ws *HTTPStrategy) WithBasicAuth(username, password string) *HTTPStrategy
- func (ws *HTTPStrategy) WithBody(reqdata io.Reader) *HTTPStrategy
- func (ws *HTTPStrategy) WithForcedIPv4LocalHost() *HTTPStrategy
- func (ws *HTTPStrategy) WithHeaders(headers map[string]string) *HTTPStrategy
- func (ws *HTTPStrategy) WithMethod(method string) *HTTPStrategy
- func (ws *HTTPStrategy) WithPollInterval(pollInterval time.Duration) *HTTPStrategy
- func (ws *HTTPStrategy) WithPort(port nat.Port) *HTTPStrategy
- func (ws *HTTPStrategy) WithResponseHeadersMatcher(matcher func(http.Header) bool) *HTTPStrategy
- func (ws *HTTPStrategy) WithResponseMatcher(matcher func(body io.Reader) bool) *HTTPStrategy
- func (ws *HTTPStrategy) WithStartupTimeout(timeout time.Duration) *HTTPStrategy
- func (ws *HTTPStrategy) WithStatusCodeMatcher(statusCodeMatcher func(status int) bool) *HTTPStrategy
- func (ws *HTTPStrategy) WithTLS(useTLS bool, tlsconf ...*tls.Config) *HTTPStrategy
- type HealthStrategy
- func (ws *HealthStrategy) Timeout() *time.Duration
- func (ws *HealthStrategy) WaitUntilReady(ctx context.Context, target StrategyTarget) error
- func (ws *HealthStrategy) WithPollInterval(pollInterval time.Duration) *HealthStrategy
- func (ws *HealthStrategy) WithStartupTimeout(startupTimeout time.Duration) *HealthStrategy
- type HostPortStrategy
- func (hp *HostPortStrategy) Timeout() *time.Duration
- func (hp *HostPortStrategy) WaitUntilReady(ctx context.Context, target StrategyTarget) error
- func (hp *HostPortStrategy) WithPollInterval(pollInterval time.Duration) *HostPortStrategy
- func (hp *HostPortStrategy) WithStartupTimeout(startupTimeout time.Duration) *HostPortStrategy
- type LogStrategy
- func (ws *LogStrategy) AsRegexp() *LogStrategy
- func (ws *LogStrategy) Timeout() *time.Duration
- func (ws *LogStrategy) WaitUntilReady(ctx context.Context, target StrategyTarget) error
- func (ws *LogStrategy) WithOccurrence(o int) *LogStrategy
- func (ws *LogStrategy) WithPollInterval(pollInterval time.Duration) *LogStrategy
- func (ws *LogStrategy) WithStartupTimeout(timeout time.Duration) *LogStrategy
- type MultiStrategy
- func (ms *MultiStrategy) Timeout() *time.Duration
- func (ms *MultiStrategy) WaitUntilReady(ctx context.Context, target StrategyTarget) error
- func (ms *MultiStrategy) WithDeadline(deadline time.Duration) *MultiStrategy
- func (ms *MultiStrategy) WithStartupTimeout(timeout time.Duration) Strategydeprecated
- func (ms *MultiStrategy) WithStartupTimeoutDefault(timeout time.Duration) *MultiStrategy
- type NopStrategy
- type NopStrategyTarget
- func (st NopStrategyTarget) Exec(_ context.Context, _ []string, _ ...exec.ProcessOption) (int, io.Reader, error)
- func (st NopStrategyTarget) Host(_ context.Context) (string, error)
- func (st NopStrategyTarget) Inspect(_ context.Context) (*types.ContainerJSON, error)
- func (st NopStrategyTarget) Logs(_ context.Context) (io.ReadCloser, error)
- func (st NopStrategyTarget) MappedPort(_ context.Context, n nat.Port) (nat.Port, error)
- func (st NopStrategyTarget) Ports(_ context.Context) (nat.PortMap, error)deprecated
- func (st NopStrategyTarget) State(_ context.Context) (*types.ContainerState, error)
- type Strategy
- type StrategyTarget
- type StrategyTimeout
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ExecStrategy ¶
type ExecStrategy struct { // additional properties ExitCodeMatcher func(exitCode int) bool ResponseMatcher func(body io.Reader) bool PollInterval time.Duration // contains filtered or unexported fields }
Example ¶
ctx := context.Background() req := testcontainers.ContainerRequest{ Image: "localstack/localstack:latest", WaitingFor: wait.ForExec([]string{"awslocal", "dynamodb", "list-tables"}), } localstack, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{ ContainerRequest: req, Started: true, }) if err != nil { log.Fatalf("failed to start container: %s", err) } defer func() { if err := localstack.Terminate(ctx); err != nil { log.Fatalf("failed to terminate container: %s", err) } }() state, err := localstack.State(ctx) if err != nil { log.Fatalf("failed to get container state: %s", err) // nolint:gocritic } fmt.Println(state.Running)
Output: true
func ForExec ¶
func ForExec(cmd []string) *ExecStrategy
ForExec is a convenience method to assign ExecStrategy
func NewExecStrategy ¶
func NewExecStrategy(cmd []string) *ExecStrategy
NewExecStrategy constructs an Exec strategy ...
func (*ExecStrategy) Timeout ¶
func (ws *ExecStrategy) Timeout() *time.Duration
func (*ExecStrategy) WaitUntilReady ¶
func (ws *ExecStrategy) WaitUntilReady(ctx context.Context, target StrategyTarget) error
func (*ExecStrategy) WithExitCode ¶
func (ws *ExecStrategy) WithExitCode(exitCode int) *ExecStrategy
func (*ExecStrategy) WithExitCodeMatcher ¶
func (ws *ExecStrategy) WithExitCodeMatcher(exitCodeMatcher func(exitCode int) bool) *ExecStrategy
func (*ExecStrategy) WithPollInterval ¶
func (ws *ExecStrategy) WithPollInterval(pollInterval time.Duration) *ExecStrategy
WithPollInterval can be used to override the default polling interval of 100 milliseconds
func (*ExecStrategy) WithResponseMatcher ¶
func (ws *ExecStrategy) WithResponseMatcher(matcher func(body io.Reader) bool) *ExecStrategy
func (*ExecStrategy) WithStartupTimeout ¶
func (ws *ExecStrategy) WithStartupTimeout(startupTimeout time.Duration) *ExecStrategy
WithStartupTimeout can be used to change the default startup timeout
type ExitStrategy ¶
type ExitStrategy struct { // additional properties PollInterval time.Duration // contains filtered or unexported fields }
ExitStrategy will wait until container exit
func ForExit ¶
func ForExit() *ExitStrategy
ForExit is the default construction for the fluid interface.
For Example:
wait. ForExit(). WithPollInterval(1 * time.Second)
func NewExitStrategy ¶
func NewExitStrategy() *ExitStrategy
NewExitStrategy constructs with polling interval of 100 milliseconds without timeout by default
func (*ExitStrategy) Timeout ¶
func (ws *ExitStrategy) Timeout() *time.Duration
func (*ExitStrategy) WaitUntilReady ¶
func (ws *ExitStrategy) WaitUntilReady(ctx context.Context, target StrategyTarget) error
WaitUntilReady implements Strategy.WaitUntilReady
func (*ExitStrategy) WithExitTimeout ¶
func (ws *ExitStrategy) WithExitTimeout(exitTimeout time.Duration) *ExitStrategy
WithExitTimeout can be used to change the default exit timeout
func (*ExitStrategy) WithPollInterval ¶
func (ws *ExitStrategy) WithPollInterval(pollInterval time.Duration) *ExitStrategy
WithPollInterval can be used to override the default polling interval of 100 milliseconds
type HTTPStrategy ¶
type HTTPStrategy struct { // additional properties Port nat.Port Path string StatusCodeMatcher func(status int) bool ResponseMatcher func(body io.Reader) bool UseTLS bool AllowInsecure bool TLSConfig *tls.Config // TLS config for HTTPS Method string // http method Body io.Reader // http request body Headers map[string]string ResponseHeadersMatcher func(headers http.Header) bool PollInterval time.Duration UserInfo *url.Userinfo ForceIPv4LocalHost bool // contains filtered or unexported fields }
Example ¶
https://github.com/samkhawase/testcontainers-go/issues/183
// waitForHTTPWithDefaultPort { ctx := context.Background() req := testcontainers.ContainerRequest{ Image: "nginx:latest", ExposedPorts: []string{"80/tcp"}, WaitingFor: wait.ForHTTP("/").WithStartupTimeout(10 * time.Second), } c, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{ ContainerRequest: req, Started: true, }) if err != nil { log.Fatalf("failed to start container: %s", err) } // } defer func() { if err := c.Terminate(ctx); err != nil { log.Fatalf("failed to terminate container: %s", err) } }() state, err := c.State(ctx) if err != nil { log.Fatalf("failed to get container state: %s", err) // nolint:gocritic } fmt.Println(state.Running)
Output: true
func ForHTTP ¶
func ForHTTP(path string) *HTTPStrategy
ForHTTP is a convenience method similar to Wait.java https://github.com/testcontainers/testcontainers-java/blob/1d85a3834bd937f80aad3a4cec249c027f31aeb4/core/src/main/java/org/testcontainers/containers/wait/strategy/Wait.java
func NewHTTPStrategy ¶
func NewHTTPStrategy(path string) *HTTPStrategy
NewHTTPStrategy constructs a HTTP strategy waiting on port 80 and status code 200
func (*HTTPStrategy) Timeout ¶
func (ws *HTTPStrategy) Timeout() *time.Duration
func (*HTTPStrategy) WaitUntilReady ¶
func (ws *HTTPStrategy) WaitUntilReady(ctx context.Context, target StrategyTarget) error
WaitUntilReady implements Strategy.WaitUntilReady
func (*HTTPStrategy) WithAllowInsecure ¶
func (ws *HTTPStrategy) WithAllowInsecure(allowInsecure bool) *HTTPStrategy
func (*HTTPStrategy) WithBasicAuth ¶
func (ws *HTTPStrategy) WithBasicAuth(username, password string) *HTTPStrategy
Example ¶
// waitForBasicAuth { ctx := context.Background() req := testcontainers.ContainerRequest{ Image: "gogs/gogs:0.11.91", ExposedPorts: []string{"3000/tcp"}, WaitingFor: wait.ForHTTP("/").WithBasicAuth("username", "password"), } gogs, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{ ContainerRequest: req, Started: true, }) if err != nil { log.Fatalf("failed to start container: %s", err) } // } defer func() { if err := gogs.Terminate(ctx); err != nil { log.Fatalf("failed to terminate container: %s", err) } }() state, err := gogs.State(ctx) if err != nil { log.Fatalf("failed to get container state: %s", err) // nolint:gocritic } fmt.Println(state.Running)
Output: true
func (*HTTPStrategy) WithBody ¶
func (ws *HTTPStrategy) WithBody(reqdata io.Reader) *HTTPStrategy
func (*HTTPStrategy) WithForcedIPv4LocalHost ¶
func (ws *HTTPStrategy) WithForcedIPv4LocalHost() *HTTPStrategy
WithForcedIPv4LocalHost forces usage of localhost to be ipv4 127.0.0.1 to avoid ipv6 docker bugs https://github.com/moby/moby/issues/42442 https://github.com/moby/moby/issues/42375
Example ¶
ctx := context.Background() req := testcontainers.ContainerRequest{ Image: "nginx:latest", ExposedPorts: []string{"8080/tcp", "80/tcp"}, WaitingFor: wait.ForHTTP("/").WithForcedIPv4LocalHost(), } c, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{ ContainerRequest: req, Started: true, }) if err != nil { log.Fatalf("failed to start container: %s", err) } defer func() { if err := c.Terminate(ctx); err != nil { log.Fatalf("failed to terminate container: %s", err) } }() state, err := c.State(ctx) if err != nil { log.Fatalf("failed to get container state: %s", err) // nolint:gocritic } fmt.Println(state.Running)
Output: true
func (*HTTPStrategy) WithHeaders ¶
func (ws *HTTPStrategy) WithHeaders(headers map[string]string) *HTTPStrategy
Example ¶
capath := filepath.Join("testdata", "root.pem") cafile, err := os.ReadFile(capath) if err != nil { log.Fatalf("can't load ca file: %v", err) } certpool := x509.NewCertPool() if !certpool.AppendCertsFromPEM(cafile) { log.Fatalf("the ca file isn't valid") } ctx := context.Background() // waitForHTTPHeaders { tlsconfig := &tls.Config{RootCAs: certpool, ServerName: "testcontainer.go.test"} req := testcontainers.ContainerRequest{ FromDockerfile: testcontainers.FromDockerfile{ Context: "testdata", }, ExposedPorts: []string{"6443/tcp"}, WaitingFor: wait.ForHTTP("/headers"). WithTLS(true, tlsconfig). WithPort("6443/tcp"). WithHeaders(map[string]string{"X-request-header": "value"}). WithResponseHeadersMatcher(func(headers http.Header) bool { return headers.Get("X-response-header") == "value" }, ), } // } c, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{ ContainerRequest: req, Started: true, }) if err != nil { log.Fatalf("failed to start container: %s", err) } defer func() { if err := c.Terminate(ctx); err != nil { log.Fatalf("failed to terminate container: %s", err) } }() state, err := c.State(ctx) if err != nil { log.Fatalf("failed to get container state: %s", err) // nolint:gocritic } fmt.Println(state.Running)
Output: true
func (*HTTPStrategy) WithMethod ¶
func (ws *HTTPStrategy) WithMethod(method string) *HTTPStrategy
func (*HTTPStrategy) WithPollInterval ¶
func (ws *HTTPStrategy) WithPollInterval(pollInterval time.Duration) *HTTPStrategy
WithPollInterval can be used to override the default polling interval of 100 milliseconds
func (*HTTPStrategy) WithPort ¶
func (ws *HTTPStrategy) WithPort(port nat.Port) *HTTPStrategy
Example ¶
// waitForHTTPWithPort { ctx := context.Background() req := testcontainers.ContainerRequest{ Image: "nginx:latest", ExposedPorts: []string{"8080/tcp", "80/tcp"}, WaitingFor: wait.ForHTTP("/").WithPort("80/tcp"), } c, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{ ContainerRequest: req, Started: true, }) if err != nil { log.Fatalf("failed to start container: %s", err) } // } defer func() { if err := c.Terminate(ctx); err != nil { log.Fatalf("failed to terminate container: %s", err) } }() state, err := c.State(ctx) if err != nil { log.Fatalf("failed to get container state: %s", err) // nolint:gocritic } fmt.Println(state.Running)
Output: true
func (*HTTPStrategy) WithResponseHeadersMatcher ¶
func (ws *HTTPStrategy) WithResponseHeadersMatcher(matcher func(http.Header) bool) *HTTPStrategy
func (*HTTPStrategy) WithResponseMatcher ¶
func (ws *HTTPStrategy) WithResponseMatcher(matcher func(body io.Reader) bool) *HTTPStrategy
func (*HTTPStrategy) WithStartupTimeout ¶
func (ws *HTTPStrategy) WithStartupTimeout(timeout time.Duration) *HTTPStrategy
WithStartupTimeout can be used to change the default startup timeout
func (*HTTPStrategy) WithStatusCodeMatcher ¶
func (ws *HTTPStrategy) WithStatusCodeMatcher(statusCodeMatcher func(status int) bool) *HTTPStrategy
func (*HTTPStrategy) WithTLS ¶
func (ws *HTTPStrategy) WithTLS(useTLS bool, tlsconf ...*tls.Config) *HTTPStrategy
type HealthStrategy ¶
type HealthStrategy struct { // additional properties PollInterval time.Duration // contains filtered or unexported fields }
HealthStrategy will wait until the container becomes healthy
func ForHealthCheck ¶
func ForHealthCheck() *HealthStrategy
ForHealthCheck is the default construction for the fluid interface.
For Example:
wait. ForHealthCheck(). WithPollInterval(1 * time.Second)
func NewHealthStrategy ¶
func NewHealthStrategy() *HealthStrategy
NewHealthStrategy constructs with polling interval of 100 milliseconds and startup timeout of 60 seconds by default
func (*HealthStrategy) Timeout ¶
func (ws *HealthStrategy) Timeout() *time.Duration
func (*HealthStrategy) WaitUntilReady ¶
func (ws *HealthStrategy) WaitUntilReady(ctx context.Context, target StrategyTarget) error
WaitUntilReady implements Strategy.WaitUntilReady
func (*HealthStrategy) WithPollInterval ¶
func (ws *HealthStrategy) WithPollInterval(pollInterval time.Duration) *HealthStrategy
WithPollInterval can be used to override the default polling interval of 100 milliseconds
func (*HealthStrategy) WithStartupTimeout ¶
func (ws *HealthStrategy) WithStartupTimeout(startupTimeout time.Duration) *HealthStrategy
WithStartupTimeout can be used to change the default startup timeout
type HostPortStrategy ¶
type HostPortStrategy struct { // Port is a string containing port number and protocol in the format "80/tcp" // which Port nat.Port PollInterval time.Duration // contains filtered or unexported fields }
func ForExposedPort ¶
func ForExposedPort() *HostPortStrategy
ForExposedPort constructs an exposed port strategy. Alias for `NewHostPortStrategy("")`. This strategy waits for the first port exposed in the Docker container.
func ForListeningPort ¶
func ForListeningPort(port nat.Port) *HostPortStrategy
ForListeningPort is a helper similar to those in Wait.java https://github.com/testcontainers/testcontainers-java/blob/1d85a3834bd937f80aad3a4cec249c027f31aeb4/core/src/main/java/org/testcontainers/containers/wait/strategy/Wait.java
func NewHostPortStrategy ¶
func NewHostPortStrategy(port nat.Port) *HostPortStrategy
NewHostPortStrategy constructs a default host port strategy
func (*HostPortStrategy) Timeout ¶
func (hp *HostPortStrategy) Timeout() *time.Duration
func (*HostPortStrategy) WaitUntilReady ¶
func (hp *HostPortStrategy) WaitUntilReady(ctx context.Context, target StrategyTarget) error
WaitUntilReady implements Strategy.WaitUntilReady
func (*HostPortStrategy) WithPollInterval ¶
func (hp *HostPortStrategy) WithPollInterval(pollInterval time.Duration) *HostPortStrategy
WithPollInterval can be used to override the default polling interval of 100 milliseconds
func (*HostPortStrategy) WithStartupTimeout ¶
func (hp *HostPortStrategy) WithStartupTimeout(startupTimeout time.Duration) *HostPortStrategy
WithStartupTimeout can be used to change the default startup timeout
type LogStrategy ¶
type LogStrategy struct { // additional properties Log string IsRegexp bool Occurrence int PollInterval time.Duration // contains filtered or unexported fields }
LogStrategy will wait until a given log entry shows up in the docker logs
func ForLog ¶
func ForLog(log string) *LogStrategy
ForLog is the default construction for the fluid interface.
For Example:
wait. ForLog("some text"). WithPollInterval(1 * time.Second)
func NewLogStrategy ¶
func NewLogStrategy(log string) *LogStrategy
NewLogStrategy constructs with polling interval of 100 milliseconds and startup timeout of 60 seconds by default
func (*LogStrategy) AsRegexp ¶
func (ws *LogStrategy) AsRegexp() *LogStrategy
AsRegexp can be used to change the default behavior of the log strategy to use regexp instead of plain text
func (*LogStrategy) Timeout ¶
func (ws *LogStrategy) Timeout() *time.Duration
func (*LogStrategy) WaitUntilReady ¶
func (ws *LogStrategy) WaitUntilReady(ctx context.Context, target StrategyTarget) error
WaitUntilReady implements Strategy.WaitUntilReady
func (*LogStrategy) WithOccurrence ¶
func (ws *LogStrategy) WithOccurrence(o int) *LogStrategy
func (*LogStrategy) WithPollInterval ¶
func (ws *LogStrategy) WithPollInterval(pollInterval time.Duration) *LogStrategy
WithPollInterval can be used to override the default polling interval of 100 milliseconds
func (*LogStrategy) WithStartupTimeout ¶
func (ws *LogStrategy) WithStartupTimeout(timeout time.Duration) *LogStrategy
WithStartupTimeout can be used to change the default startup timeout
type MultiStrategy ¶
type MultiStrategy struct { // additional properties Strategies []Strategy // contains filtered or unexported fields }
func ForAll ¶
func ForAll(strategies ...Strategy) *MultiStrategy
func (*MultiStrategy) Timeout ¶
func (ms *MultiStrategy) Timeout() *time.Duration
func (*MultiStrategy) WaitUntilReady ¶
func (ms *MultiStrategy) WaitUntilReady(ctx context.Context, target StrategyTarget) error
func (*MultiStrategy) WithDeadline ¶
func (ms *MultiStrategy) WithDeadline(deadline time.Duration) *MultiStrategy
WithDeadline sets a time.Duration which limits all wait strategies
func (*MultiStrategy) WithStartupTimeout
deprecated
func (ms *MultiStrategy) WithStartupTimeout(timeout time.Duration) Strategy
WithStartupTimeout sets a time.Duration which limits all wait strategies
Deprecated: use WithDeadline
func (*MultiStrategy) WithStartupTimeoutDefault ¶
func (ms *MultiStrategy) WithStartupTimeoutDefault(timeout time.Duration) *MultiStrategy
WithStartupTimeoutDefault sets the default timeout for all inner wait strategies
type NopStrategy ¶
type NopStrategy struct {
// contains filtered or unexported fields
}
func ForNop ¶
func ForNop( waitUntilReady func(context.Context, StrategyTarget) error, ) *NopStrategy
func (*NopStrategy) Timeout ¶
func (ws *NopStrategy) Timeout() *time.Duration
func (*NopStrategy) WaitUntilReady ¶
func (ws *NopStrategy) WaitUntilReady(ctx context.Context, target StrategyTarget) error
func (*NopStrategy) WithStartupTimeout ¶
func (ws *NopStrategy) WithStartupTimeout(timeout time.Duration) *NopStrategy
type NopStrategyTarget ¶
type NopStrategyTarget struct { ReaderCloser io.ReadCloser ContainerState types.ContainerState }
func (NopStrategyTarget) Exec ¶
func (st NopStrategyTarget) Exec(_ context.Context, _ []string, _ ...exec.ProcessOption) (int, io.Reader, error)
func (NopStrategyTarget) Inspect ¶
func (st NopStrategyTarget) Inspect(_ context.Context) (*types.ContainerJSON, error)
func (NopStrategyTarget) Logs ¶
func (st NopStrategyTarget) Logs(_ context.Context) (io.ReadCloser, error)
func (NopStrategyTarget) MappedPort ¶
func (NopStrategyTarget) State ¶
func (st NopStrategyTarget) State(_ context.Context) (*types.ContainerState, error)
type Strategy ¶
type Strategy interface {
WaitUntilReady(context.Context, StrategyTarget) error
}
Strategy defines the basic interface for a Wait Strategy
type StrategyTarget ¶
type StrategyTarget interface { Host(context.Context) (string, error) Inspect(context.Context) (*types.ContainerJSON, error) Ports(ctx context.Context) (nat.PortMap, error) // Deprecated: use Inspect instead MappedPort(context.Context, nat.Port) (nat.Port, error) Logs(context.Context) (io.ReadCloser, error) Exec(context.Context, []string, ...exec.ProcessOption) (int, io.Reader, error) State(context.Context) (*types.ContainerState, error) }
type StrategyTimeout ¶
StrategyTimeout allows MultiStrategy to configure a Strategy's Timeout