mysqltest

package
v0.0.0-...-5346417 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGormMySQlDB

func NewGormMySQlDB(ctx context.Context, opts ...gorm.Option) (*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 WithContainerName

func WithContainerName(name string) Option

func WithContainerPort

func WithContainerPort(port nat.Port) Option

func WithImageName

func WithImageName(name string) Option

func WithMaxWaitTime

func WithMaxWaitTime(interval time.Duration) 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