Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Session *mgo.Session // Global mgo Session Dial string // http://godoc.org/labix.org/v2/mgo#Dial Method string // clone, copy, new http://godoc.org/labix.org/v2/mgo#Session.New Database string // (optional) database name to connect to )
Functions ¶
func ControllerInit ¶
func ControllerInit()
func MethodError ¶
Types ¶
type MongoController ¶
type MongoController struct { *revel.Controller MongoSession *mgo.Session // named MongoSession to avoid collision with revel.Session Database *mgo.Database // shortcut to the database you want to connect to by default }
func (*MongoController) Begin ¶
func (c *MongoController) Begin() revel.Result
Connect to mgo if we haven't already and return a copy/new/clone of the session and database connection
func (*MongoController) End ¶
func (c *MongoController) End() revel.Result
Close the controller session if we have an active one.
Click to show internal directories.
Click to hide internal directories.