dockertest

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KillAllTestDatabases

func KillAllTestDatabases()

KillAllTestDatabases deletes all test databases.

func Retry

func Retry(maxWait time.Duration, failAfter time.Duration, f func() error) (err error)

Retry executes a f until no error is returned or failAfter is reached.

func RunTestPostgreSQL

func RunTestPostgreSQL(t *testing.T, containerHost, containerName, containerExposedPort, pgUsername, pgPassword, pgDatabase, pgDockerTag string)

runs postgresql based on the variables passed into it.

Types

type OnExit

type OnExit struct {
	sync.Mutex
	// contains filtered or unexported fields
}

OnExit helps with cleaning up docker test.

func NewOnExit

func NewOnExit() *OnExit

NewOnExit create a new OnExit instance.

func (*OnExit) Add

func (at *OnExit) Add(f func())

Add adds a task that is executed on SIGINT, SIGKILL, SIGTERM.

func (*OnExit) Exit

func (at *OnExit) Exit(status int)

Exit wraps os.Exit

Jump to

Keyboard shortcuts

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