mongo

package
v0.0.0-...-be0592b Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2019 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

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 string
	MaxIdleConns string
	Transaction  string
}

Config config

func ParseConfigFromKV

func ParseConfigFromKV(prefix string, conifgmap map[string]string) Config

ParseConfigFromKV returns a new 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) GetMaxIdleConns

func (c Config) GetMaxIdleConns() int

func (Config) GetMaxOpenConns

func (c Config) GetMaxOpenConns() int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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