Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DB mongo.Database
DB holds database connection
Functions ¶
func NewDBContext ¶
NewDBContext returns a new Context according to app performance
Types ¶
type User ¶
type User struct { ID primitive.ObjectID `bson:"_id"` Username string `bson:"username"` Email string `bson:"email"` Password string `bson:"password"` }
User is the default user struct
var NilUser User
NilUser is the nil value for User
func UserFromToken ¶
UserFromToken returns the User which is authenticated with this Token
Click to show internal directories.
Click to hide internal directories.