repo

package
v0.0.0-...-f2be101 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2021 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 Product

type Product struct {
	gorm.Model
	SKU         string  `json:"sku" gorm:"unique"`
	ProductName string  `json:"product_name"`
	Qty         float64 `json:"qty"`
	Price       float64 `json:"price"`
	Unit        string  `json:"unit"`
	Status      int32   `json:"status"`
}

func (*Product) Create

func (p *Product) Create(ctx context.Context) error

func (*Product) Delete

func (p *Product) Delete(ctx context.Context) error

func (*Product) ListWithPagination

func (p *Product) ListWithPagination(ctx context.Context, pg *util.Pagination, sort string) ([]Product, *util.Pagination, error)

func (*Product) Update

func (p *Product) Update(ctx context.Context) error

type User

type User struct {
	gorm.Model
	Email    string `json:"email" gorm:"unique"`
	Password string `json:"password"`
}

User defines the user in db

func (*User) CheckPassword

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

CheckPassword checks user password

func (*User) Create

func (u *User) Create(ctx context.Context) error

Create data user

func (*User) GetWithEmail

func (u *User) GetWithEmail(ctx context.Context, email string) error

func (*User) HashPassword

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

HashPassword encrypts user password

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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