utils

package
v1.1.0-beta-3 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2025 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package utils provides utilities supporting the smoke tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainerExternalHost

func ContainerExternalHost(ctx context.Context, container testcontainers.Container, port string) (*url.URL, error)

ContainerExternalHost gets the external host of for a specific container based on what port testcontainers forwarded to on the host machine.

This is only needed for external communications between application and the container. This is NOT needed for container to container interactions on the same network

func ContainerWaitForLog

func ContainerWaitForLog(ctx context.Context, input *WaitForLogInput) error

ContainerWaitForLog polls the logs of the container to see if a `log` message exists. If the timeout is exceeded, an error returns.

func WaitForCondition

func WaitForCondition(
	ctx context.Context,
	timeout time.Duration,
	poll time.Duration,
	condition func() (bool, error),
) error

WaitForCondition waits for a specific condition to return true.

Types

type WaitForLogInput

type WaitForLogInput struct {
	Container *testcontainers.Container
	Log       string
	Timeout   time.Duration
	Poll      time.Duration
}

Jump to

Keyboard shortcuts

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