Files
fn-serverless/examples/blog/database/database.go
Carlos C d5fb1afda7 Revert "Assert License (#224)"
This reverts commit a61c4dab78.
2016-11-06 09:25:12 -08:00

21 lines
273 B
Go

package database
import "gopkg.in/mgo.v2"
type Database struct {
Session *mgo.Session
}
func New(uri string) *Database {
session, err := mgo.Dial(uri)
if err != nil {
panic(err)
}
session.SetMode(mgo.Monotonic, true)
return &Database{
Session: session,
}
}