dbtest

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TestDB

type TestDB struct {
	// contains filtered or unexported fields
}

TestDB is a struct that contains the test database container and the DSN to connect to it.

func NewTestDB

func NewTestDB(waitDbForBeingReady bool) *TestDB

NewTestDB creates a new Test database (need docker to be installed and running). If waitDbForBeingReady is true, it will wait for the database to be ready to accept connections. It returns a pointer to a TestDB struct. The TestDB struct contains the test database container and the DSN to connect to it. Don't forget to call the Teardown method to clean up the resources.

func (*TestDB) GetDSN

func (t *TestDB) GetDSN() string

GetDSN returns the DSN to connect to the test database.

func (*TestDB) Teardown

func (t *TestDB) Teardown()

Teardown cleans up the resources.

Jump to

Keyboard shortcuts

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