user

package
v0.0.0-...-7518d33 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 4, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPasswordByEmail

func CheckPasswordByEmail(email string, password string) (uint, bool)

return: user id, is valid

func CheckPasswordByUsername

func CheckPasswordByUsername(username string, password string) (uint, bool)

return: user id, is valid

func GenValidateCode

func GenValidateCode(width int) string

func HashPassword

func HashPassword(password string) []byte

func IsCodeMatch

func IsCodeMatch(code string, email string) bool

func IsValidPassword

func IsValidPassword(password string) bool

func IsValidURL

func IsValidURL(urlStr string) bool

func RegisterUser

func RegisterUser(username string, email string, password string) (uint, error)

RegisterUser registers a user. It returns the user id and an error. The error is nil if the registration is successful.

func ReturnWithUser

func ReturnWithUser(c *gin.Context, usr model.User, err error)

func SendVerificationCode

func SendVerificationCode(email string) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL