dockerdb

package
v1.10.3 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOutboundIP added in v1.10.0

func GetOutboundIP() string

func MockRDS added in v1.10.0

func MockRDS(t GinkgoTInterface, ctx context.Context, cli client.Client, secretName, userName, databaseName string) (*sql.DB, string, func())

func MockRDSCredentials added in v1.10.2

func MockRDSCredentials(t GinkgoTInterface, ctx context.Context, cli client.Client, fakeDSN, secretName string) func()

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