mongodb

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: May 19, 2018 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientAddrs

func ClientAddrs(addrs []string) func(*Client)

ClientAddrs set the address to connect to MongoDB.

func ClientDatabase

func ClientDatabase(database string) func(*Client)

ClientDatabase eset the database name to use.

func ClientPassword

func ClientPassword(password string) func(*Client)

ClientPassword set the password to authenticate.

func ClientPoolLimit

func ClientPoolLimit(limit int) func(*Client)

ClientPoolLimit set the limit of connections per server.

func ClientReplicaSet

func ClientReplicaSet(replicaSet string) func(*Client)

ClientReplicaSet set the replicaSet.

func ClientTimeout

func ClientTimeout(timeout time.Duration) func(*Client)

ClientTimeout set the timeout during operations.

func ClientUsername

func ClientUsername(username string) func(*Client)

ClientUsername set the username to authenticate.

Types

type Client

type Client struct {
	Database string
	// contains filtered or unexported fields
}

Client is used to interact with MongoDB.

func NewClient

func NewClient(options ...func(*Client)) (*Client, error)

NewClient returns a configured client to access MongoDB.

func (*Client) Session

func (c *Client) Session() *mgo.Session

Session return a configured session to access MongoDB.

func (*Client) Stop

func (c *Client) Stop()

Stop close the session with MongoDB.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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