dbc

package
v0.0.0-...-c45e23a Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultEnv = map[string]string{
		"POSTGRES_PASSWORD": "qwerty",
		"POSTGRES_USER":     "postgres",
	}
	ErrInvalidContextPath = errors.New("invalid context path")
	ErrInvalidDockerFile  = errors.New("invalid Dockerfile")
	ErrNotADirectory      = errors.New("not a directory")
)

Functions

This section is empty.

Types

type Container

type Container struct {
	C testcontainers.Container

	Env env.Env
	// contains filtered or unexported fields
}

func New

func New(contextPath, dockerFile string) (*Container, error)

func (*Container) Accept

func (c *Container) Accept(l testcontainers.Log)

func (*Container) DBConn

func (c *Container) DBConn() *pgxpool.Pool

func (*Container) DBPort

func (c *Container) DBPort() int

func (*Container) DBURL

func (c *Container) DBURL() string

func (*Container) LoadSQL

func (c *Container) LoadSQL(db *pgxpool.Pool, filePath, fileNameRegexp string, parallel int, recursive bool) error

func (*Container) RestartInCurrentCtx

func (c *Container) RestartInCurrentCtx() error

func (*Container) Start

func (c *Container) Start(ctx context.Context, dockerNetworkName, dbName string) error

func (*Container) StartLogger

func (c *Container) StartLogger(ctx context.Context)

func (*Container) Stop

func (c *Container) Stop(ctx context.Context) error

func (*Container) Terminate

func (c *Container) Terminate(ctx context.Context) error

Jump to

Keyboard shortcuts

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