models

package
v0.0.0-...-228e6a4 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Setup

func Setup() (*gorm.DB, error)

func VerifyPassword

func VerifyPassword(password, hashedPassword string) error

Types

type Grocery

type Grocery struct {
	gorm.Model
	Name     string `json: "name"`
	Quantity int    `json: "quantity"`
	UserId   uint
}

type User

type User struct {
	gorm.Model
	Username  string `gorm:"size:255;not null;unique" json:"username"`
	Password  string `gorm:"size:255;not null;" json:"-"`
	Groceries []Grocery
}

func GetUserById

func GetUserById(uid uint) (User, error)

func (*User) HashPassword

func (user *User) HashPassword() error

Jump to

Keyboard shortcuts

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