Documentation ¶
Index ¶
- func DoesExist(ctx context.Context, name string, image optional.Option[string]) (bool, error)
- func Exec(ctx context.Context, name string, command ...string) error
- func GetContainerPort(ctx context.Context, name string, port int) (int, error)
- func PollContainerHealth(ctx context.Context, containerName string, timeout time.Duration) error
- func Pull(ctx context.Context, imageName string) error
- func Run(ctx context.Context, image, name string, hostToContainerPort map[int]int, ...) error
- func RunMySQL(ctx context.Context, name string, port int, image string) error
- func RunPostgres(ctx context.Context, name string, port int, image string) error
- func Start(ctx context.Context, name string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Exec ¶
Exec runs a command in the given container, stream to stderr. Return an error if the command fails.
func GetContainerPort ¶
GetContainerPort returns the host TCP port of the given container's exposed port.
func PollContainerHealth ¶
PollContainerHealth polls the given container until it is healthy or the timeout is reached.
func Run ¶
func Run(ctx context.Context, image, name string, hostToContainerPort map[int]int, volume optional.Option[string], env ...string) error
Run starts a new detached container with the given image, name, port map, and (optional) volume mount.
func RunMySQL ¶ added in v0.398.0
RunMySQL runs a new detached postgres container with the given name and exposed port.
func RunPostgres ¶ added in v0.398.0
RunPostgres runs a new detached postgres container with the given name and exposed port.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.