models

package
v0.0.0-...-401e79f Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashPassword

func HashPassword(password string) (string, error)

Types

type User

type User struct {
	ID       string `json:"id"`
	Username string `json:"username"`
	Email    string `json:"email"`
	Password string `json:"password"`
}

func GetUserByEmail

func GetUserByEmail(email string) (*User, error)

func NewUser

func NewUser(username, email, password string) *User

func (*User) ComparePassword

func (u *User) ComparePassword(password string) (bool, error)

func (*User) Save

func (u *User) Save() error

func (*User) ValidateRegisterUser

func (u *User) ValidateRegisterUser() (bool, map[string]error)

Jump to

Keyboard shortcuts

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