Documentation ¶
Overview ¶
Package auth implement Account model used for authentication.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { ID bson.ObjectId `json:"id,omitempty" bson:"_id,omitempty"` Username string `json:"username" bson:"username"` Email string `json:"email" bson:"email"` Password string `json:"password,omitempty" bson:"password"` }
Account contains account login data.
func (*Account) ComparePassword ¶
ComparePassword return true, if argument hash is equals to a.Password.
func (*Account) GeneratePassword ¶
GeneratePassword encrypt a.Password using bcrypt algorithm.
Click to show internal directories.
Click to hide internal directories.