models

package
v0.0.0-...-e944992 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

Functions

func ConnectDataBase

func ConnectDataBase()

func LoginCheck

func LoginCheck(email string, password string) (string, error)

func VerifyPassword

func VerifyPassword(password, hashedPassword string) error

Types

type User

type User struct {
	gorm.Model
	FirstName    string `json:"first_name" binding:"required"`
	LastName     string `json:"last_name" binding:"required"`
	Email        string `json:"email" binding:"required" gorm:"unique"`
	Password     string `json:"password" binding:"required"`
	IsAmbassador bool   `json:"-"`
}

func GetUserByID

func GetUserByID(uid uint) (User, error)

func (*User) BeforeSave

func (user *User) BeforeSave() error

func (*User) Prepare

func (user *User) Prepare()

func (*User) PrepareGive

func (user *User) PrepareGive()

func (*User) SaveUser

func (u *User) SaveUser() (*User, error)

Jump to

Keyboard shortcuts

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