* WIP: start mongo engine * WIP: mongo accessor and admin * integrate mongo store to main * disable mongo tests by default, only in CI * connection with constructor * add mongo buffered writer * buffered mongo writer * fix nil responses on an empty list from mongo * missing mongo index for scores * cancelable store * add gridfs implementation of avatar store * fix race on mongo session copy * gridfs avatars without tmp files * move avatar store * minor comments and refactoring for avatar store * merged from current master * simplify gridfs reader * lint: fix minor warns * test mongo against env defined url * pass MONGO_REMARK_TEST to docker and travis * set dockerfile env for mongo test url * increase connect timeout in mongo tests * pass MONGO_REMARK_TEST to drone build * add MONGO_REMARK_TEST to branch stage of drone * mass mongo test url via build_args_from_env * populate mongo IP to docker build hosts * test env * pass mongo ip via .mongo * remove .mongo temp from git * add .mongo -> env to linter step * allow more time to autoflush writer test * default mongo tests to "mongo" if not in env * merge fresh master into * add test for mongo cleanup * msg for a failed test * lazy fix for failed test * add an ability to skip all mongo tests * add backend dev instructions * remove unused code from mongo server * move mongo testing to connection_test * restore testing.go * lint: minor warns for testing code
36 lines
1.4 KiB
Go
36 lines
1.4 KiB
Go
// Package mgo (pronounced as "mango") offers a rich MongoDB driver for Go.
|
|
//
|
|
// Detailed documentation of the API is available at GoDoc:
|
|
//
|
|
// https://godoc.org/github.com/globalsign/mgo
|
|
//
|
|
// Usage of the driver revolves around the concept of sessions. To
|
|
// get started, obtain a session using the Dial function:
|
|
//
|
|
// session, err := mgo.Dial(url)
|
|
//
|
|
// This will establish one or more connections with the cluster of
|
|
// servers defined by the url parameter. From then on, the cluster
|
|
// may be queried with multiple consistency rules (see SetMode) and
|
|
// documents retrieved with statements such as:
|
|
//
|
|
// c := session.DB(database).C(collection)
|
|
// err := c.Find(query).One(&result)
|
|
//
|
|
// New sessions are typically created by calling session.Copy on the
|
|
// initial session obtained at dial time. These new sessions will share
|
|
// the same cluster information and connection pool, and may be easily
|
|
// handed into other methods and functions for organizing logic.
|
|
// Every session created must have its Close method called at the end
|
|
// of its life time, so its resources may be put back in the pool or
|
|
// collected, depending on the case.
|
|
//
|
|
// There is a sub-package that provides support for BSON, which can be
|
|
// used by itself as well:
|
|
//
|
|
// https://godoc.org/github.com/globalsign/mgo/bson
|
|
//
|
|
// For more details, see the documentation for the types and methods.
|
|
//
|
|
package mgo
|