dockerdb

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RetryFn

func RetryFn(t *testing.T, mightFail func() error, retryInterval, timeout time.Duration) error

RetryFn retries a function until it succeeds or the timeout is reached

func Run

func Run(cfg Config) (*sql.DB, string, func())

Run a PostgreSQL database in a Docker container and return a connection to it. The caller is responsible for calling the func() to prevent leaking containers.

func StartNetwork

func StartNetwork(networkName string) func()

Types

type Config

type Config struct {
	HostName  string
	DockerTag string
	Username  string
	Password  string
	Database  string
	// Network, optional, is the name of the Docker network to attach the container to.
	Network string
}

Config to run a PostgreSQL database in a Docker container.

Jump to

Keyboard shortcuts

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