mongodb

package
v0.0.0-...-0eec0e3 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dial

func Dial(conf *Config, logger glog.Logger) (*mgo.Session, error)

Dial dial to target server with Monotonic mode

Types

type Config

type Config struct {
	Addrs    []string      `envconfig:"MONGODB_ADDRS" default:"127.0.0.1:27017"`
	Database string        `envconfig:"MONGODB_DATABASE" default:"ofriends"`
	Username string        `envconfig:"MONGODB_USERNAME"`
	Password string        `envconfig:"MONGODB_PASSWORD"`
	Timeout  time.Duration `envconfig:"MONGODB_TIMEOUT" default:"10s"`
}

Config hold MongoDB configuration information

Jump to

Keyboard shortcuts

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