biz

package
v0.0.0-...-657e486 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

ProviderSet is biz providers.

Functions

This section is empty.

Types

type CatalogUsecase

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

CartUsecase is a Cart usecase.

func NewCatalogUsecase

func NewCatalogUsecase(repo ProductRepo, logger log.Logger) *CatalogUsecase

NewCartUsecase new a Cart usecase.

func (*CatalogUsecase) GetProduct

func (uc *CatalogUsecase) GetProduct(ctx context.Context, productId string) (product.Product, error)

GetCart get cart of a user.

func (*CatalogUsecase) ListProducts

func (uc *CatalogUsecase) ListProducts(ctx context.Context, pageSize int, pageToken string) ([]product.Product, error)

AddItem add cart item into a cart for a user.

func (*CatalogUsecase) SearchProducts

func (uc *CatalogUsecase) SearchProducts(ctx context.Context, query string, pageSize int, pageToken string) ([]product.Product, error)

EmptyCart clear all items in a cart.

type ProductRepo

type ProductRepo interface {
	Query(context.Context, string, int, string) ([]product.Product, error)
	GetProduct(context.Context, string) (product.Product, error)
}

ProductRepo is a Cart repo.

Jump to

Keyboard shortcuts

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