databaseutils

package module
v0.0.0-...-66e587a Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

README

databaseutils

Build Status

databaseutils is a small library to start database containers. The library contains default options but the options can be overwrite.

Installing

Install the library by the following command:

go get git.cryptic.systems/volker.raschek/databaseutils

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidAttr = errors.New("Invalid DatabaseOption attribute")
)

Functions

This section is empty.

Types

type PostgresOptions

type PostgresOptions struct {
	ContainerEnv           map[string]string
	ContainerImage         string
	ContainerLabels        map[string]string
	ContainerName          string
	ContainerNetworks      map[string][]string
	ContainerNetworkLabels map[string]map[string]string
	ContainerPort          string
	Driver                 string
	DSN                    string
	HostPort               string
}

func NewPostgresDatabase

func NewPostgresDatabase(t *testing.T) (*PostgresOptions, func())

NewPostgresDatabase starts a new postgres database based on default values

func NewPostgresOptions

func NewPostgresOptions() *PostgresOptions

NewPostgresOptions returns a new PostgresOptions structs with default values

func StartPostgres

func StartPostgres(t *testing.T, pgOptions *PostgresOptions) (*PostgresOptions, func())

StartPostgres starts a postgres container image based on the PostgresOption struct

func (*PostgresOptions) Validate

func (dbOptions *PostgresOptions) Validate() error

Validate the DatabaseOption struct, if all required atrributes are valid

Jump to

Keyboard shortcuts

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