Ocean/CustomerDB/AccessDB.go
Thorsten Sommer f33f7b5c29 Refactoring, Bugfix & Updates
+ Refactored all imports
+ Fixed a bug for the logging regarding removing \n \t \r
+ Updated to current MGO release
+ Changed the name of ICCC
2014-10-19 19:19:11 +02:00

29 lines
616 B
Go

package CustomerDB
import (
"gopkg.in/mgo.v2"
)
/*
Get the database instance of the MGo Mongo driver.
*/
func DB() (session *mgo.Session, database *mgo.Database) {
session = mainSession.Copy()
database = session.DB(databaseDB)
database.Login(databaseUsername, databasePassword)
return
}
/*
Get directly the GridFS instance of the Mgo Mongo driver.
*/
func GridFS() (session *mgo.Session, filesystem *mgo.GridFS) {
session = mainSession.Copy()
database := session.DB(databaseDB)
database.Login(databaseUsername, databasePassword)
filesystem = database.GridFS(`fs`)
return
}