mongo

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

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

Go to latest
Published: Aug 6, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connector

type Connector struct {
	Client     *mongo.Client
	Database   *mongo.Database
	Collection *mongo.Collection
}

Connector ... struct containing info on how to connect to a mongo db

func NewMongoConnector

func NewMongoConnector() *Connector

NewMongoConnector ... Factory

func (*Connector) CloseConnection

func (c *Connector) CloseConnection()

CloseConnection ... Disconnects and deallocates resources

func (*Connector) InitConnection

func (c *Connector) InitConnection(def *conf.DataSourceDefinition)

InitConnection ... Instantiate the connection with the remote DB

func (*Connector) ValidateDataSourceDefinition

func (c *Connector) ValidateDataSourceDefinition(def *conf.DataSourceDefinition) error

ValidateDataSourceDefinition ... validates the provided data source definition

Jump to

Keyboard shortcuts

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