database

package
v0.0.0-...-8f3b465 Latest Latest
Warning

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

Go to latest
Published: May 10, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mongo

type Mongo struct {
	Database *mongo.Database
	// contains filtered or unexported fields
}

Mongo is the struct containing the necessary methods to connect to a mongo database

func NewMongoConnection

func NewMongoConnection() *Mongo

NewMongoConnection injects the dependencies into a new Mongo struct and returns a pointer to that struct

func (*Mongo) ConnectToDB

func (conn *Mongo) ConnectToDB(connectionURL string, dbName string) error

ConnectToDB connects to a mongo database with the url passed as a paremeter

func (*Mongo) Disconnect

func (conn *Mongo) Disconnect() error

Disconnect gracefully disconnects the client from the server

Jump to

Keyboard shortcuts

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