mongotesting

package
v0.0.0-...-6f9dc6e Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(c context.Context) (*mongo.Client, error)

NewClient 连接 docker MongoDB 客户端(测试执行完会清空数据)

func NewDefaultClient

func NewDefaultClient(c context.Context) (*mongo.Client, error)

NewDefaultClient 连接本地 MongoDB 客户端,可以查看测试时的数据是否正确

func RunWithMongoInDocker

func RunWithMongoInDocker(m *testing.M) int

RunWithMongoInDocker 在 docker 容器中运行 MongoDB

func SetupIndexes

func SetupIndexes(c context.Context, d *mongo.Database) error

SetupIndexes sets up indexes for the given database.

Types

This section is empty.

Jump to

Keyboard shortcuts

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