Documentation ¶
Index ¶
Constants ¶
View Source
const UserLoginSessionKey = "userLogin"
UserLoginSessionKey session key for user login
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Preferences ¶
Preferences of website users
type User ¶
type User struct { Login string Firstname string Lastname string Email string PhoneNumber string Password string Salt string Version int8 LastLogin int32 LoginFailures int8 LastLoginFail int32 Status UserStatus Preferences }
User users of the website
func NewUser ¶
func NewUser(login, firstname, lastname, email, phonenumber, password string, sendSecurityAlerts, sendNewsLetter, enable2fa bool) (user User, err error)
NewUser creates new user
func (*User) Authenticate ¶
Authenticate checks user password
func (*User) SetPassword ¶
SetPassword sets user password
type UserStatus ¶
type UserStatus int8
UserStatus account status
const ( UserUnverified UserStatus = iota UserPasswordReset UserActive UserSuspended UserDisabled UserDeleted )
User account status
Click to show internal directories.
Click to hide internal directories.