wait

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package wait provides functionalities for mocking testcontainers-go/wait.

Index

Constants

This section is empty.

Variables

View Source
var NoMockStrategy = MockStrategy()

NoMockStrategy is no mock Strategy.

View Source
var NoMockStrategyTarget = MockStrategyTarget()

NoMockStrategyTarget is no mock StrategyTarget.

Functions

This section is empty.

Types

type Strategy

type Strategy struct {
	mock.Mock
}

Strategy is a wait.Strategy.

func (*Strategy) WaitUntilReady

func (s *Strategy) WaitUntilReady(ctx context.Context, target wait.StrategyTarget) error

WaitUntilReady satisfies wait.Strategy interface.

type StrategyMocker

type StrategyMocker func(tb testing.TB) *Strategy

StrategyMocker is Strategy mocker.

func MockStrategy

func MockStrategy(mocks ...func(s *Strategy)) StrategyMocker

MockStrategy creates Strategy mock with cleanup to ensure all the expectations are met.

type StrategyTarget

type StrategyTarget struct {
	mock.Mock
}

StrategyTarget is a wait.StrategyTarget.

func (*StrategyTarget) Exec

func (s *StrategyTarget) Exec(ctx context.Context, cmd []string) (int, io.Reader, error)

Exec satisfies wait.StrategyTarget interface.

func (*StrategyTarget) Host

func (s *StrategyTarget) Host(ctx context.Context) (string, error)

Host satisfies wait.StrategyTarget interface.

func (*StrategyTarget) Logs

func (s *StrategyTarget) Logs(ctx context.Context) (io.ReadCloser, error)

Logs satisfies wait.StrategyTarget interface.

func (*StrategyTarget) MappedPort

func (s *StrategyTarget) MappedPort(ctx context.Context, port nat.Port) (nat.Port, error)

MappedPort satisfies wait.StrategyTarget interface.

func (*StrategyTarget) Ports added in v0.6.0

func (s *StrategyTarget) Ports(ctx context.Context) (nat.PortMap, error)

Ports satisfies wait.StrategyTarget interface.

func (*StrategyTarget) State

State satisfies wait.StrategyTarget interface.

type StrategyTargetMocker

type StrategyTargetMocker func(tb testing.TB) *StrategyTarget

StrategyTargetMocker is StrategyTarget mocker.

func MockStrategyTarget

func MockStrategyTarget(mocks ...func(t *StrategyTarget)) StrategyTargetMocker

MockStrategyTarget creates StrategyTarget mock with cleanup to ensure all the expectations are met.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL