biz

package
v0.0.0-...-c8c1909 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2022 License: Apache-2.0, 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, item 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