mysqltest

package
v0.0.0-...-e1b74f7 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGormMySQlDB

func NewGormMySQlDB(ctx context.Context) (*gorm.DB, error)

Types

type MySQL

type MySQL struct {
	dockertest.DockerItemGenerator
	ImageName     string
	ContainerPort nat.Port
	DatabaseName  string
	// contains filtered or unexported fields
}

func New

func New(generator dockertest.DockerItemGenerator, databaseName string, opts ...Option) *MySQL

func (*MySQL) RunInDocker

func (s *MySQL) RunInDocker(m *testing.M) int

RunInDocker runs the tests with a mysql db instance in a docker container.

type Option

type Option interface {
	// contains filtered or unexported methods
}

func WithConnOptions

func WithConnOptions(opts string) Option

func WithContainerCmd

func WithContainerCmd(cmd []string) Option

func WithContainerEnv

func WithContainerEnv(env []string) Option

func WithContainerPort

func WithContainerPort(port nat.Port) Option

func WithImageName

func WithImageName(name string) Option

func WithWaitInterval

func WithWaitInterval(interval time.Duration) Option

Jump to

Keyboard shortcuts

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