Documentation ¶
Overview ¶
This package provides mongo connectivity support
Index ¶
- Constants
- func CloneMasterSession(sessionId string) (*mgo.Session, error)
- func CloneMonotonicSession(sessionId string) (*mgo.Session, error)
- func CloneSession(sessionId string, useSession string) (mongoSession *mgo.Session, err error)
- func CloseSession(sessionId string, mongoSession *mgo.Session)
- func CollectionExists(sessionId string, mongoSession *mgo.Session, useDatabase string, ...) bool
- func CopyMasterSession(sessionId string) (*mgo.Session, error)
- func CopyMonotonicSession(sessionId string) (*mgo.Session, error)
- func CopySession(sessionId string, useSession string) (mongoSession *mgo.Session, err error)
- func CreateSession(sessionId string, mode string, sessionName string, hosts []string, ...) (err error)
- func Execute(sessionId string, mongoSession *mgo.Session, databaseName string, ...) (err error)
- func GetCollection(mongoSession *mgo.Session, useDatabase string, useCollection string) (*mgo.Collection, error)
- func Shutdown(sessionId string) (err error)
- func Startup(sessionId string) (err error)
- func ToString(queryMap bson.M) string
- type MongoCall
Constants ¶
const ( MASTER_SESSION = "master" MONOTONIC_SESSION = "monotonic" )
Variables ¶
This section is empty.
Functions ¶
func CloneMasterSession ¶
CloneMasterSession makes a clone of the master session for client use
func CloneMonotonicSession ¶
CloneMonotonicSession makes a clone of the monotinic session for client use
func CloneSession ¶
CopySession makes a clone of the specified session for client use
func CloseSession ¶
CloseSession puts the connection back into the pool
func CollectionExists ¶
func CollectionExists(sessionId string, mongoSession *mgo.Session, useDatabase string, useCollection string) bool
CollectionExists returns true if the collection name exists in the specified database
func CopyMasterSession ¶
CopyMasterSession makes a copy of the master session for client use
func CopyMonotonicSession ¶
CopyMonotonicSession makes a copy of the monotonic session for client use
func CopySession ¶
CopySession makes a copy of the specified session for client use
func CreateSession ¶
func CreateSession(sessionId string, mode string, sessionName string, hosts []string, databaseName string, username string, password string) (err error)
CreateSession creates a connection pool for use
func Execute ¶
func Execute(sessionId string, mongoSession *mgo.Session, databaseName string, collectionName string, mongoCall MongoCall) (err error)
Execute the MongoDB literal function
func GetCollection ¶
func GetCollection(mongoSession *mgo.Session, useDatabase string, useCollection string) (*mgo.Collection, error)
GetCollection returns a reference to a collection for the specified database and collection name
Types ¶
type MongoCall ¶
type MongoCall func(*mgo.Collection) error
MongoCall defines a type of function that can be used to excecute code against MongoDB