mongo

package
v0.0.0-...-59e9b52 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2014 License: BSD-2-Clause-Views Imports: 9 Imported by: 0

Documentation

Overview

This package provides mongo connectivity support

Index

Constants

View Source
const (
	MASTER_SESSION    = "master"
	MONOTONIC_SESSION = "monotonic"
)

Variables

This section is empty.

Functions

func CloneMasterSession

func CloneMasterSession(sessionId string) (*mgo.Session, error)

CloneMasterSession makes a clone of the master session for client use

func CloneMonotonicSession

func CloneMonotonicSession(sessionId string) (*mgo.Session, error)

CloneMonotonicSession makes a clone of the monotinic session for client use

func CloneSession

func CloneSession(sessionId string, useSession string) (mongoSession *mgo.Session, err error)

CopySession makes a clone of the specified session for client use

func CloseSession

func CloseSession(sessionId string, mongoSession *mgo.Session)

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

func CopyMasterSession(sessionId string) (*mgo.Session, error)

CopyMasterSession makes a copy of the master session for client use

func CopyMonotonicSession

func CopyMonotonicSession(sessionId string) (*mgo.Session, error)

CopyMonotonicSession makes a copy of the monotonic session for client use

func CopySession

func CopySession(sessionId string, useSession string) (mongoSession *mgo.Session, err error)

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

func Shutdown

func Shutdown(sessionId string) (err error)

Shutdown systematically brings the manager down gracefully

func Startup

func Startup(sessionId string) (err error)

Startup brings the manager to a running state

func ToString

func ToString(queryMap bson.M) string

ToString converts the quer map to a string

Types

type MongoCall

type MongoCall func(*mgo.Collection) error

MongoCall defines a type of function that can be used to excecute code against MongoDB

Jump to

Keyboard shortcuts

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