biz

package
v0.0.0-...-4241208 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: MIT, MIT Imports: 3 Imported by: 0

README

Biz

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProviderSet = wire.NewSet(NewCartUseCase)

ProviderSet is biz providers.

Functions

This section is empty.

Types

type Cart

type Cart struct {
	UserId int64
	Items  []Item
}

type CartRepo

type CartRepo interface {
	GetCart(ctx context.Context, uid int64) (*Cart, error)
	SaveCart(ctx context.Context, c *Cart) error
	DeleteCart(ctx context.Context, uid int64) error
}

type CartUseCase

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

func NewCartUseCase

func NewCartUseCase(repo CartRepo, logger log.Logger) *CartUseCase

func (*CartUseCase) AddItem

func (uc *CartUseCase) AddItem(ctx context.Context, uid int64, in Item) (c *Cart, err error)

func (*CartUseCase) DeleteCart

func (uc *CartUseCase) DeleteCart(ctx context.Context, uid int64) error

func (*CartUseCase) DeleteItem

func (uc *CartUseCase) DeleteItem(ctx context.Context, uid int64, itemId int64) (c *Cart, err error)

func (*CartUseCase) GetCart

func (uc *CartUseCase) GetCart(ctx context.Context, uid int64) (*Cart, error)

func (*CartUseCase) UpdateItem

func (uc *CartUseCase) UpdateItem(ctx context.Context, uid, itemId, quantity int64) (c *Cart, err error)

type Item

type Item struct {
	Id       int64
	Quantity int64
}

Jump to

Keyboard shortcuts

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