cart

package
v0.0.0-...-1bf90d9 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpApi

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

func NewCartHttpApi

func NewCartHttpApi(
	cartService Service,
	validator *validator.Validate,
) *HttpApi

func (*HttpApi) AddItem

func (h *HttpApi) AddItem(writer http.ResponseWriter, request *http.Request) (err error)

func (*HttpApi) Checkout

func (h *HttpApi) Checkout(writer http.ResponseWriter, request *http.Request) (err error)

func (*HttpApi) DeleteItem

func (h *HttpApi) DeleteItem(writer http.ResponseWriter, request *http.Request) (err error)

func (*HttpApi) DeleteItemsByUserID

func (h *HttpApi) DeleteItemsByUserID(writer http.ResponseWriter, request *http.Request) (err error)

func (*HttpApi) GetCart

func (h *HttpApi) GetCart(writer http.ResponseWriter, request *http.Request) (err error)

type Service

type Service interface {
	AddItem(ctx context.Context, userID int64, skuID int64, count uint16) error
	DeleteItem(ctx context.Context, userID int64, skuID int64) error
	DeleteItemsByUserID(ctx context.Context, userID int64) error
	GetCart(ctx context.Context, userID int64) (*models.Cart, error)
	Checkout(ctx context.Context, userID int64) (orderID int64, err error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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