Documentation ¶
Index ¶
Constants ¶
View Source
const (
// UserCollectionName - Collection name
UserCollectionName = "users"
)
Variables ¶
View Source
var Users *mgo.Collection
Users - User Collection
Functions ¶
This section is empty.
Types ¶
type User ¶
type User struct { ID bson.ObjectId `bson:"_id,omitempty"` Name string `bson:"name"` Username string `bson:"username"` Email string `bson:"email"` Password string `bson:"password"` }
User model
func NewUser ¶
NewUser - Create a new user(make a copy of this user and modify for saving) (mostly for triggering setters)
params -- user {*User} User
returns -- {*User} The better and save ready user
func (*User) SetPassword ¶
SetPassword - Setter for the password field TODO: Encrypt the password
params -- password {string}
Click to show internal directories.
Click to hide internal directories.