Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
Db database
)
Functions ¶
func Disconnect ¶
func Disconnect()
func TripCollectionToJSON ¶
TripCollectionToJSON passes every object through bson before converting to json. To serialize inline properly. TODO: replace inline with something else
Types ¶
type Trip ¶
type Trip struct { ID bson.ObjectId `bson:"_id,omitempty"` // ID of the trip UserID bson.ObjectId `bson:"userId,omitempty"` // UserId of the trip owner Data bson.M `bson:",inline"` // extra Data about the trip }
Trip represents a single trip
type User ¶
type User struct { ID bson.ObjectId `bson:"_id,omitempty"` Name string `bson:"name"` Email string `bson:"email"` AccessToken string `bson:"access_token"` RefreshToken string `bson:"refresh_token"` }
User represents a logged in user
func FindAndUpdateOrCreateUser ¶
func FindAndUpdateOrCreateUser(userDetails google.GoogleUser) (User, error)
FindAndUpdateOrCreateUser performs an upsert to the user
func FindUserByEmail ¶
FindUserByEmail finds a user by e-mail
Click to show internal directories.
Click to hide internal directories.