Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CheckFunc ¶
func CheckCommandSucceeds ¶ added in v1.3.2
CheckCommandSucceeds creates CheckFunc. See CommandSucceeds.
func CheckLogOccurrence ¶
CheckLogOccurrence creates CheckFunc. See LogContains.
type Fetcher ¶
type Fetcher interface { ContainerID() string Status(ctx context.Context) (*types.ContainerState, error) Ports() nat.PortMap Log(ctx context.Context) (io.ReadCloser, error) Exec(ctx context.Context, cmd ...string) ([]byte, error) }
Fetcher provides several ways to access the state of the container.
type Option ¶
func WithInterval ¶
WithInterval sets the interval between container readiness checks.
func WithTimeout ¶
WithTimeout sets the timeout for waiting for the container to be ready.
type Waiter ¶
type Waiter struct {
// contains filtered or unexported fields
}
func CommandSucceeds ¶ added in v1.3.2
CommandSucceeds waits for the success of given command.
func LogContains ¶
LogContains waits for the given number of occurrences of the given message in the container log.
func New ¶
New creates a Waiter that waits for the container to be ready. CheckFunc is the criteria for evaluating readiness. Use Fetcher to obtain the container status.
Waiter repeatedly checks the readiness until first success. We can set interval and timeout by WithInterval and WithTimeout. The default value for the interval is 500ms and for the timeout is 30sec.