store

package
v0.0.0-...-20f091a Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRecordAlreadyExists = errors.New("record already exists")
View Source
var ErrRecordNotFound = errors.New("record not found")

Functions

func DBTransformError

func DBTransformError(err error) error

Types

type ImageProductCustom

type ImageProductCustom struct {
	ID       int32  `sql:"primary_key" alias:"image_product.id"`
	ImageURL string `alias:"image_product.image_url"`
}

type PriceNowCustom

type PriceNowCustom struct {
	ID        int32     `sql:"primary_key" alias:"price_now.id"`
	Price     float64   `alias:"price_now.price"`
	Currency  string    `alias:"price_now.currency"`
	CreatedAt time.Time `alias:"price_now.created_at"`
}

type ProductStore

type ProductStore struct {
	DB *sql.DB
}

func NewProductStore

func NewProductStore(db *sql.DB) *ProductStore

func (*ProductStore) GetAllProducts

func (s *ProductStore) GetAllProducts(userID uint32) ([]ResultGetAllProducts, error)

type ResultGetAllProducts

type ResultGetAllProducts struct {
	ID   int32  `sql:"primary_key" alias:"products.id"`
	Name string `alias:"products.name"`
	URL  string `alias:"products.url"`
	model.Sellers
	ImageProduct []ImageProductCustom
	PriceNow     []PriceNowCustom
}

Jump to

Keyboard shortcuts

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