usermodel

package
v0.0.0-...-47bc475 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User

type User struct {
	ID            int                            `json:"id"`
	Email         string                         `json:"email" `
	Password      string                         `json:"password" `
	Salt          []byte                         `json:"salt"`
	Name          string                         `json:"name"`
	Role          string                         `json:"role"`
	CreatedAt     time.Time                      `json:"createdAt"`
	UpdatedAt     time.Time                      `json:"updatedAt"`
	OwnedFiles    []learningmodels.LearningFiles `json:"ownedFiles"`
	LearningGoals []learningmodels.LearningGoals `json:"learningGoals"`
}

func (*User) CheckPassword

func (user *User) CheckPassword(providedPassword string) error

CheckPassword takes a string as a parameter and compares it to the user's encrypted password

func (*User) HashPassword

func (user *User) HashPassword(password string) error

HashPassword takes a string as a parameter and encrypts it using argon2

Jump to

Keyboard shortcuts

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