Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type User ¶
type User struct { ID int `json:"id"` Email string `json:"email"` Password string `json:"password,omitempty"` EncryptedPassword string `json:"-"` }
User object that has id, email, password and encrypted password fields
func (*User) BeforeCreate ¶
BeforeCreate func. Encrypting password func that encrypts password and writes encrypted version in User's EncryptedPassword field.
func (*User) ComparePassword ¶
ComparePassword func. Compares password with its encrypted variant
Click to show internal directories.
Click to hide internal directories.