Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Postgres ¶
type Postgres struct {
// contains filtered or unexported fields
}
Postgres is an mlab container running postgres
func New ¶
New create a new Postgres object it start a postgress database of the specified version, and allow processes to connect to it
if tb is not null the postgres object is related to this testing object: logs will be sent to it, and New either succeed or fail the test with Fatal, so errors don't need to be tested.
log is optional function to log stderr/stdout of the database, can be nil and then default are used (either tb.Log or stdout)
func (*Postgres) Close ¶
Close releases resources connected to the postgres object (in particular kill the container)
func (*Postgres) GetAddressPort ¶
GetAddressPort return the address and port used to access the DB
func (*Postgres) GetDB ¶
GetDB get an sql.DB object conected to the postgres with the specified database name