mgotest

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: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(ctx context.Context, opts ...*options.ClientOptions) (*mongo.Client, error)

NewClient creates a client connected to the mongo instance in docker.

Types

type MongoDB

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

func New

func New(dockerItemGenerator dockertest.DockerItemGenerator, opts ...Option) *MongoDB

func (*MongoDB) RunInDocker

func (mgo *MongoDB) RunInDocker(m *testing.M) int

RunInDocker runs the tests with a mongodb instance in a docker container.

type Option

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

func WithConnOptions

func WithConnOptions(opts 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