mongoclient

package
v0.0.0-...-0569e1c Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2021 License: Apache-2.0 Imports: 5 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MongoClientManagerInit

func MongoClientManagerInit(configs []MongoClientConfig) error

Types

type MongoClient

type MongoClient struct {
	Client         *mongo.Client
	DatabaseClient *mongo.Database
}

func NewMongoClient

func NewMongoClient(c MongoClientConfig) (*MongoClient, error)

type MongoClientConfig

type MongoClientConfig struct {
	Name     string
	URL      string
	Database string
}

Mongo client config

type MongoClientManager

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

func GetMongoClientManager

func GetMongoClientManager() *MongoClientManager

func (*MongoClientManager) GetMongoClient

func (r *MongoClientManager) GetMongoClient(name string) *mongo.Client

func (*MongoClientManager) GetMongoDatabaseClient

func (r *MongoClientManager) GetMongoDatabaseClient(name string) *mongo.Database

Jump to

Keyboard shortcuts

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