Documentation ¶
Index ¶
- Variables
- func InitApp(conf *database.Config, minioConfig MinIOConfig) (_ application.Application, err error)
- func InitDatabase(config *database.Config) (db database.Database, err error)
- func InitRestServer(app application.Application, apiKey []byte) (*restserver.S, error)
- type Adminer
- type AdminerOption
- type MinIO
- type MinIOConfig
- type Network
- type Option
- type Postgres
- func (p *Postgres) Config() db.Config
- func (p *Postgres) DSN() string
- func (p *Postgres) Database() string
- func (p *Postgres) DatabaseName() string
- func (p *Postgres) Drop() (err error)
- func (p *Postgres) IpContainer() string
- func (p *Postgres) NetworkID() string
- func (p *Postgres) Port() int
- func (p *Postgres) PortContainer() int
- func (p *Postgres) Start() (err error)
- func (p *Postgres) Stop(removeNetwork bool) (err error)
Constants ¶
This section is empty.
Variables ¶
var ErrAdminerNotInitialized = fmt.Errorf("adminer not initialized")
var ErrMinioNotInitialized = fmt.Errorf("minio not initialized")
var ErrPostgresAdminerIsNil = fmt.Errorf("postgres: adminer is nil")
var ErrPostgresNotInitialized = fmt.Errorf("postgres not initialized")
Functions ¶
func InitApp ¶
func InitApp(conf *database.Config, minioConfig MinIOConfig) (_ application.Application, err error)
initialize the application using the config provided by newly created postgres
func InitDatabase ¶
initialize a database connection using the config establish connection with the database
func InitRestServer ¶
func InitRestServer(app application.Application, apiKey []byte) (*restserver.S, error)
initialize the rest server from getting random port from the free ports
Types ¶
type Adminer ¶
type Adminer struct {
// contains filtered or unexported fields
}
func NewAdminer ¶
func NewAdminer(opts ...AdminerOption) *Adminer
func NewAdminerStarted ¶
func NewAdminerStarted(opts ...AdminerOption) (*Adminer, error)
NewAdminerStarted returns adminer running in a docker dontainer.
func (*Adminer) IpContainer ¶
IpContainer returns the ip of the container in th network with `networkID`
func (*Adminer) PortContainer ¶
PortContainer returns port the service is listening to inside the container.
type AdminerOption ¶
type AdminerOption func(*Adminer)
func WithAdminerHost ¶
func WithAdminerHost(d string) AdminerOption
func WithAdminerNetwork ¶
func WithAdminerNetwork(networkID string) AdminerOption
WithNetwork by default adminer creates it's own random network. Pass a network id to make adminer join a existings network.
func WithFixedHostPort ¶
func WithFixedHostPort(port string) AdminerOption
WithFixedHostPort sets a fixed host port
type MinIO ¶
type MinIO struct {
// contains filtered or unexported fields
}
func NewMinioStarted ¶
func (*MinIO) Config ¶
func (m *MinIO) Config() MinIOConfig
Config return the config object usually passed to application inside bob
type MinIOConfig ¶
type Option ¶
type Option func(*Postgres)
func WithCredentials ¶
func WithDatabaseName ¶
func WithDebug ¶
WithDebug in debug mode postgres will additionaly start a adminer container to inspect the database. It also waits at the end of the test for SIGTERM to enable database inspection.
func WithHostname ¶
func WithPostgresNetwork ¶
WithPostgresNetwork by default postgres creates it's own random network. Pass a network id to make postgres join a existings network.
type Postgres ¶
type Postgres struct {
// contains filtered or unexported fields
}
func NewPostgres ¶
func NewPostgresStarted ¶
NewPostgresStarted returns a postgres database running in a docker dontainer.
func (*Postgres) DatabaseName ¶
DatabaseName returns the database name
func (*Postgres) IpContainer ¶
IpContainer returns the ip of the container in th network with `networkID`
func (*Postgres) PortContainer ¶
PortContainer returns port the service is listening to inside the container.