models

package
v0.0.0-...-baa3690 Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GoogleUserData

type GoogleUserData struct {
	Email         string `json:"email"`
	FamilyName    string `json:"family_name"`
	GivenName     string `json:"given_name"`
	ID            string `json:"id"`
	Locale        string `json:"locale"`
	Name          string `json:"name"`
	Picture       string `json:"picture"`
	VerifiedEmail bool   `json:"verified_email"`
}

type User

type User struct {
	gorm.Model
	Name          string `json:"name"`
	Username      string `json:"username" gorm:"unique;default:null"`
	Email         string `json:"email" gorm:"unique; not null;default:null"`
	Password      string `json:"-" gorm:"default:null"` // FIXME: should be not null
	Picture       string `json:"picture" gorm:"default:null"`
	LoginMethod   string `json:"login_method" gorm:"default:null"`
	EmailVerified bool   `json:"email_verified" gorm:"default:false"`
}

@Description User account

func NewUser

func NewUser(email, password string) *User

func (*User) EncryptPassword

func (user *User) EncryptPassword() error

func (*User) IsPasswordMatch

func (user *User) IsPasswordMatch(password string) bool

func (*User) IsValidEmail

func (user *User) IsValidEmail() bool

Jump to

Keyboard shortcuts

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