Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ContextKeyDatabase defines the db context key ContextKeyDatabase = request.ContextKey("db") )
Functions ¶
This section is empty.
Types ¶
type DatabaseAccessor ¶
type DatabaseAccessor struct {
*mgo.Session
}
DatabaseAccessor represents a mongo database encapsulation
func InitDB ¶
func InitDB(dsn string) (*DatabaseAccessor, error)
InitDB creates a new mongo db server
type MongoDB ¶
type MongoDB struct {
// contains filtered or unexported fields
}
func NewMongoDB ¶
func NewMongoDB(accessor *DatabaseAccessor) *MongoDB
Click to show internal directories.
Click to hide internal directories.