repository

package
v0.0.0-...-8f657ed Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2022 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IProductRepository

type IProductRepository interface {
	InitTable() error
	FindProductByID(int64) (*model.Product, error)
	CreateProduct(*model.Product) (int64, error)
	DeleteProductByID(int64) error
	UpdateProduct(*model.Product) error
	FindAll() ([]model.Product, error)
}

func NewProductRepository

func NewProductRepository(db *gorm.DB) IProductRepository

productRepository

type ProductRepository

type ProductRepository struct {
	// contains filtered or unexported fields
}

func (*ProductRepository) CreateProduct

func (u *ProductRepository) CreateProduct(product *model.Product) (int64, error)

func (*ProductRepository) DeleteProductByID

func (u *ProductRepository) DeleteProductByID(productID int64) error

func (*ProductRepository) FindAll

func (u *ProductRepository) FindAll() (productAll []model.Product, err error)

func (*ProductRepository) FindProductByID

func (u *ProductRepository) FindProductByID(productID int64) (product *model.Product, err error)

func (*ProductRepository) InitTable

func (u *ProductRepository) InitTable() error

func (*ProductRepository) UpdateProduct

func (u *ProductRepository) UpdateProduct(product *model.Product) error

Jump to

Keyboard shortcuts

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