Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
func NewContainer ¶
func NewContainer(ctx context.Context, req ContainerRequest) (mc *Container, err error)
NewContainer creates an instance testcontainers.Container configured to run mongo:tag. By default, i.e, passing an empty req, the container is configured with the mongo:latest image, port 27017, a default user "user" with password "password". To override any of these options see ContainerRequest.
func (*Container) NewClient ¶
NewClient creates a new mongo client using the connection string of the Container. The connection is tested once before returning the new client.
func (*Container) NewDatabase ¶
func (c *Container) NewDatabase(name string, opts ...*options.DatabaseOptions) (*mongo.Database, error)
NewDatabase creates a new mongo client then a new database with then given name and options.
type ContainerRequest ¶
type ContainerRequest struct { tc.GenericContainerRequest User string Password string }
Click to show internal directories.
Click to hide internal directories.