database

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type GeneralOptions added in v0.2.0

type GeneralOptions 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
}

func (*GeneralOptions) Validate added in v0.2.0

func (opts *GeneralOptions) Validate() error

Validate the options if all required attributes are valid

type Options added in v0.2.0

type Options interface {
	Get() *GeneralOptions
	Validate() error
}

func NewOracleDatabase added in v0.2.0

func NewOracleDatabase(t *testing.T) (Options, func())

NewOracleDatabase starts a new oracle database based on default values

func NewOracleOptions added in v0.2.0

func NewOracleOptions() Options

NewOracleOptions returns a new OracleOptions structs with default values

func NewPostgresDatabase

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

NewPostgresDatabase starts a new postgres database based on default values

func NewPostgresOptions

func NewPostgresOptions() Options

NewPostgresOptions returns a new PostgresOptions structs with default values

func StartOracle added in v0.2.0

func StartOracle(t *testing.T, opts Options) (Options, func())

StartOracle starts a oracle container image based on the OracleOption struct

func StartPostgres

func StartPostgres(t *testing.T, opts Options) (Options, func())

StartPostgres starts a postgres container image based on the PostgresOption struct

type OracleOptions added in v0.2.0

type OracleOptions struct {
	*GeneralOptions
}

func (*OracleOptions) Get added in v0.2.0

func (opts *OracleOptions) Get() *GeneralOptions

Get returns the defined options

func (*OracleOptions) Validate added in v0.2.0

func (opts *OracleOptions) Validate() error

Validate the options if all required attributes are valid

type PostgresOptions

type PostgresOptions struct {
	*GeneralOptions
}

func (*PostgresOptions) Get added in v0.2.0

func (opts *PostgresOptions) Get() *GeneralOptions

Get returns the defined options

func (*PostgresOptions) Validate

func (opts *PostgresOptions) Validate() error

Validate the options if all required attributes are valid

Jump to

Keyboard shortcuts

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