dbutil

package
v0.0.0-...-2fdfa40 Latest Latest
Warning

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

Go to latest
Published: May 16, 2021 License: ISC Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DbConf

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

DbConf holds the database configuration information.

func NewDbConf

func NewDbConf(username string, password string, scheme string, port int, database string) *DbConf

NewDbConf creates a new DbConf with the prerequisite information.

func (*DbConf) Database

func (c *DbConf) Database() string

Database getter

func (*DbConf) Flag

func (c *DbConf) Flag(name string, value ...string) *DbConf

Flag adds a configuration flag to the DbConf

func (*DbConf) Mapped

func (c *DbConf) Mapped(mappedHost string, mappedPort int) *DbConf

Mapped adds the host and port mapped by a container.

func (*DbConf) MappedHost

func (c *DbConf) MappedHost() string

MappedHost make the mapped host available fo read

func (*DbConf) MappedPort

func (c *DbConf) MappedPort() int

MappedPort make the mapped port available for read

func (*DbConf) Password

func (c *DbConf) Password() string

Password getter

func (*DbConf) Port

func (c *DbConf) Port() int

Port getter

func (*DbConf) String

func (c *DbConf) String() string

String implements fmt.Stringer and produces a DSN format string.

func (*DbConf) Username

func (c *DbConf) Username() string

Username getter

type PostgresContainerConf

type PostgresContainerConf struct {
	*DbConf
	Image string
}

PostgresContainerConf adds and image name to a DbConf.

type PostgresStrategy

type PostgresStrategy struct {
	Port nat.Port
	// contains filtered or unexported fields
}

PostgresStrategy a wait.Strategy to wait on Postgres to start.

func NewPostgresStrategy

func NewPostgresStrategy(port nat.Port, dbConf *PostgresContainerConf) *PostgresStrategy

NewPostgresStrategy constructs a default host port strategy

func (*PostgresStrategy) WaitUntilReady

func (hp *PostgresStrategy) WaitUntilReady(ctx context.Context, target wait.StrategyTarget) (err error)

WaitUntilReady implements Strategy.WaitUntilReady

func (*PostgresStrategy) WithStartupTimeout

func (hp *PostgresStrategy) WithStartupTimeout(startupTimeout time.Duration) *PostgresStrategy

WithStartupTimeout sets startupTimeout

Jump to

Keyboard shortcuts

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