mongo

package
v0.0.0-...-cb472e6 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// if maxOpenConns isn't configured, use default value
	DefaultMaxOpenConns = 1000
	// if maxOpenConns exceeds maximum value, use maximum value
	MaximumMaxOpenConns = 3000
	// if maxIDleConns is less than minimum value, use minimum value
	MinimumMaxIdleOpenConns = 50
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Connect      string
	Address      string
	User         string
	Password     string
	Port         string
	Database     string
	Mechanism    string
	MaxOpenConns uint64
	MaxIdleConns uint64
	RsName       string
}

Config config

func (Config) BuildURI

func (c Config) BuildURI() string

BuildURI return mongo uri according to https://docs.mongodb.com/manual/reference/connection-string/ format example: mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database][?options]]

func (Config) GetMongoClient

func (c Config) GetMongoClient() (db dal.RDB, err error)

func (Config) GetMongoConf

func (c Config) GetMongoConf() local.MongoConf

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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