func GetMongoDB() *mgo.Database { datab, err := db.GetMongoDB() db.IfPanic(err) return datab }
func GetKotobaCollection() *mgo.Collection { c, err := db.GetKotobaCollection() db.IfPanic(err) return c }
func AddUser(db_ *mgo.Database, user string, email string, pass string) error { // insert user pwHash, err := bcrypt.GenerateFromPassword([]byte(pass), bcrypt.DefaultCost) db.IfPanic(err) return db.InsertUser(user, email, string(pwHash), db_) }