Documentation ¶
Index ¶
- func CheckPasswordByEmail(email string, password string) (uint, bool)
- func CheckPasswordByUsername(username string, password string) (uint, bool)
- func GenValidateCode(width int) string
- func HashPassword(password string) []byte
- func IsCodeMatch(code string, email string) bool
- func IsValidPassword(password string) bool
- func IsValidURL(urlStr string) bool
- func RegisterUser(username string, email string, password string) (uint, error)
- func ReturnWithUser(c *gin.Context, usr model.User, err error)
- func SendVerificationCode(email string) error
- func UpsertSuperAdmin()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPasswordByEmail ¶
return: user id, is valid
func CheckPasswordByUsername ¶
return: user id, is valid
func GenValidateCode ¶
func HashPassword ¶
func IsCodeMatch ¶
func IsValidPassword ¶
func IsValidURL ¶
func RegisterUser ¶
RegisterUser registers a user. It returns the user id and an error. The error is nil if the registration is successful.
func SendVerificationCode ¶
func UpsertSuperAdmin ¶
func UpsertSuperAdmin()
UpsertSuperAdmin upserts the super admin user. Super admin must be the first user and its username must be "admin". The function gets info from config. password required.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.