database

package
v0.0.0-...-d56c7b1 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CategoryDB

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

func NewCategoryDB

func NewCategoryDB(db *sql.DB) *CategoryDB

func (*CategoryDB) CreateCategory

func (cd *CategoryDB) CreateCategory(category *entity.Category) (string, error)

func (*CategoryDB) GetCategories

func (cd *CategoryDB) GetCategories() ([]*entity.Category, error)

func (*CategoryDB) GetCategory

func (cd *CategoryDB) GetCategory(id string) (*entity.Category, error)

type ProductDB

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

func NewProductDB

func NewProductDB(db *sql.DB) *ProductDB

func (*ProductDB) CreateProduct

func (pd *ProductDB) CreateProduct(Product *entity.Product) (*entity.Product, error)

func (*ProductDB) GetProduct

func (pd *ProductDB) GetProduct(id string) (*entity.Product, error)

func (*ProductDB) GetProductByCategoryID

func (pd *ProductDB) GetProductByCategoryID(categoryID string) ([]*entity.Product, error)

func (*ProductDB) GetProducts

func (pd *ProductDB) GetProducts() ([]*entity.Product, error)

Jump to

Keyboard shortcuts

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