Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Database ¶
type Database interface { SignupUser(user *User) (err error) LoginUser(user *User) (err error) UpdateUserProfile(user *User) (err error) UpdateUserPassword(user *User) (err error) UpdateUserLocale(user *User) (err error) GetUser(id uint64) (*User, error) GetDetailForUserLogin(email string) (*User, error) }
type User ¶
type User struct { // User Unique ID. Generated by snowflake. UserID uint64 `json:"user_id,string" db:"user_id"` // Mail Address used to log in to the service. Email string `json:"email" db:"email"` // password stored with bcrypt salt hash. Password string `json:"password" db:"password"` // 2FA type set by User. // 0 : Password authentication only. // 1 : TOTP Authentication. TwoFAType TwoFAType `json:"two_fa_type" db:"two_fa_type"` // The secret key is saved if 2FA for TOTP Authentication is enabled. TotpSecret string `json:"totp_secret,omitempty" db:"totp_secret"` // User location settings. Locale string `json:"locale" db:"locale"` // User role settings. // Exists for booking and is not currently in use. Role int `json:"role" db:"role"` // Date when the user was created. CreatedAt string `json:",omitempty", db:"created_at"` // Date the user last logged in. LastLogin string `json:",omitempty", db:"last_login"` // Date when the user was deleted. DeletedAt string `json:",omitempty", db:"deleted_at"` // Detailed profile of the user. Profile Profile `json:"user_profiles", db:"user_profiles"` }
Click to show internal directories.
Click to hide internal directories.