setuptest

package
v0.0.0-...-9665562 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig[T any](path string) (T, error)

func MySQLMigrateDB

func MySQLMigrateDB(options MySQLMigrateOptions) (func() error, error)

func NewMySQLDB

func NewMySQLDB(config mysql.Config) (*mysql.Mysql, error)

func NewMySQLDBSingleton

func NewMySQLDBSingleton(config mysql.Config) (*mysql.Mysql, error)

func SeedDB

func SeedDB(options MySQLSeedOptions) (func() error, error)

Types

type BuildAndRunContainer

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

func NewBuildAndRunContainer

func NewBuildAndRunContainer(options BuildAndRunContainerOptions) *BuildAndRunContainer

func (*BuildAndRunContainer) GetOptions

func (*BuildAndRunContainer) SetNetwork

func (c *BuildAndRunContainer) SetNetwork(network *dockertest.Network) *BuildAndRunContainer

func (*BuildAndRunContainer) Start

func (c *BuildAndRunContainer) Start(fn func() error) error

func (*BuildAndRunContainer) Stop

func (c *BuildAndRunContainer) Stop(fn func() error) error

type BuildAndRunContainerOptions

type BuildAndRunContainerOptions struct {
	Name            string
	ContextDir      string
	Dockerfile      string
	Env             DBEnv
	Exposed         Exposed
	PortBinding     PortBinding
	MaxWaitRetry    time.Duration
	ExpireInSeconds uint
}

type DBEnv

type DBEnv map[string]string

func (DBEnv) ToSlice

func (d DBEnv) ToSlice() []string

type Exposed

type Exposed struct {
	Protocol string
	Port     string
}

type MySQLMigrateOptions

type MySQLMigrateOptions struct {
	HostIPOverride  string
	MigrationPath   string
	MigrationDBName string
	// contains filtered or unexported fields
}

type MySQLSeedOptions

type MySQLSeedOptions struct {
	HostIPOverride string
	SeedPath       string
	SeedDBName     string
	// contains filtered or unexported fields
}

type PortBinding

type PortBinding struct {
	HostIP   string
	HostPort string
}

type RunContainer

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

func NewRunContainer

func NewRunContainer(options RunContainerOptions) *RunContainer

func (*RunContainer) SetNetwork

func (c *RunContainer) SetNetwork(network *dockertest.Network) *RunContainer

func (*RunContainer) Start

func (c *RunContainer) Start(fn func() error) error

func (*RunContainer) Stop

func (c *RunContainer) Stop(fn func() error) error

type RunContainerOptions

type RunContainerOptions struct {
	Name            string
	Repository      string
	Tag             string
	Env             DBEnv
	Exposed         Exposed
	PortBinding     PortBinding
	MaxWaitRetry    time.Duration
	ExpireInSeconds uint
}

Jump to

Keyboard shortcuts

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