userDatabase

package
v0.0.0-...-f30c324 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckUserEmailExist

func CheckUserEmailExist(email string) int

func CheckUserGoogleAccountExist

func CheckUserGoogleAccountExist(username string) int

func CheckUserNameExist

func CheckUserNameExist(username string) int

func CreateUser

func CreateUser(
	email string,
	hash_password string,
	username string,
) (userModles.UserAccount, error)

func CreateUserWithGithubLogin

func CreateUserWithGithubLogin(
	github_email string,
	github_id string,
	avatar string,
) (userModles.UserAccount, error)

func CreateUserWithGoogleLogin

func CreateUserWithGoogleLogin(
	email string,
	avatar string,
	google_id string,
) (userModles.UserAccount, error)

func GetUserAvatar

func GetUserAvatar(id string) (string, error)

func GetUserDetil

func GetUserDetil(id string) (userModles.UserDetil, error)

func Rename

func Rename(id string, new_name string) (sql.Result, error)

Types

type OauthData

type OauthData struct {
	Id           string `json:"id"`
	Email_verify bool   `json:"email_verify"`
	Email_2fa    bool   `json:"email_2fa"`
	Phone_2fa    bool   `json:"phone_2fa"`
	Totp_2fa     bool   `json:"totp_2fa"`
	Totp         string `json:"totp"`
	Default_2fa  int    `json:"default_2fa"`
}

func GetGithubAccount

func GetGithubAccount(github_id string) (OauthData, error)

func GetGoogleAccount

func GetGoogleAccount(google_id string) (OauthData, error)

func GetGoogleAccountWithEmail

func GetGoogleAccountWithEmail(email string) (OauthData, error)

type UserAuthData

type UserAuthData struct {
	Id           string `json:"id"`
	Password     string `json:"password"`
	Email_verify bool   `json:"email_verify"`
	Email_2fa    bool   `json:"email_2fa"`
	Phone_2fa    bool   `json:"phone_2fa"`
	Totp_2fa     bool   `json:"totp_2fa"`
	Totp         string `json:"totp"`
	Default_2fa  int    `json:"default_2fa"`
}

func GetUserPassword

func GetUserPassword(email string) (UserAuthData, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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