mmongo

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MongoConnection

type MongoConnection struct {
	ConnectionStringSource string
	DB                     *mongo.Client
	Connected              bool
	Database               string
}

MongoConnection is a hub which deal with mongodb connections.

func (*MongoConnection) Connect

func (mc *MongoConnection) Connect(ctx context.Context) error

Connect keeps a singleton connection with postgres.

func (*MongoConnection) GetDB

func (mc *MongoConnection) GetDB(ctx context.Context) (*mongo.Client, error)

GetDB returns a pointer to the mongodb connection, initializing it if necessary.

Jump to

Keyboard shortcuts

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