mongodb

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2021 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ERROR_CLIENT_INSTANCE   = "mongodb_connection : failed to get the mongodb client"
	ERROR_DATABASE_INSTANCE = "mongodb_database_connection : failed to get the mongodb database client"
)

Variables

This section is empty.

Functions

func CloseDatabaseClient

func CloseDatabaseClient(temp *DatabaseClientId)

func CloseDatabaseClientsByMongoClientId

func CloseDatabaseClientsByMongoClientId(temp *MongoClientId)

func CloseMongoClient

func CloseMongoClient(temp *MongoClientId)

func CreateDatabaseClient

func CreateDatabaseClient(temp *DatabaseClient)

func CreateMongoClient

func CreateMongoClient(temp *MongoClient)

func GetDatabaseClient

func GetDatabaseClient(temp *DatabaseClientId) (*mongo.Database, error)

func GetMongoClient

func GetMongoClient(temp *MongoClientId) (*mongo.Client, error)

Types

type Conf

type Conf struct {
	URI string
}

type DatabaseClient

type DatabaseClient struct {
	Id   *DatabaseClientId
	Once *sync.Once
	Conf *DatabaseConf

	Err *error
	// contains filtered or unexported fields
}

type DatabaseClientId

type DatabaseClientId struct {
	Id string
}

type DatabaseClients

type DatabaseClients struct {
	// contains filtered or unexported fields
}

type DatabaseConf

type DatabaseConf struct {
	DatabaseName  string
	MongoClientId *MongoClientId
}

type MongoClient

type MongoClient struct {
	Id        *MongoClientId
	MyContext *context.Context
	Once      *sync.Once
	Conf      *Conf

	Err *error
	// contains filtered or unexported fields
}

type MongoClientId

type MongoClientId struct {
	Id string
}

type MongoClients

type MongoClients struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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