Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncryptMessage ¶
encrypt string using bcrypt
func RequiredIf ¶
func RequiredIf(cond bool) validation.RuleFunc
helper func: if cond, validate that value cannot be blank
Types ¶
type User ¶
type User struct { Id int `json:"id"` Email string `json:"email"` Password string `json:"password,omitempty"` EncryptedPassword string `json:"-"` }
this struct corresponds with "users" table from db
func (*User) BeforeCreate ¶
encrypt password defore passing to db
func (*User) ComparePassword ¶
compare stored encrypted password with inputted one
Click to show internal directories.
Click to hide internal directories.