cart

package
v0.0.0-...-576dde9 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const AuthCTXKey contextKey = "auth_token"
View Source
const CartCTXKey contextKey = "cart_item_payload"

Variables

This section is empty.

Functions

func ErrUnauthorized

func ErrUnauthorized(w http.ResponseWriter, err error)

ErrUnauthorized is a helper for consistent unauthorized responses

Types

type CartApp

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

func NewCartApp

func NewCartApp(s *service.CartService, c *config.CartConfig, log *zerolog.Logger) *CartApp

func (*CartApp) Start

func (a *CartApp) Start(ctx context.Context) error

type CartHandler

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

func NewCartHandler

func NewCartHandler(s *service.CartService, l *zerolog.Logger) *CartHandler

func (*CartHandler) AddItem

func (h *CartHandler) AddItem(w http.ResponseWriter, r *http.Request)

func (*CartHandler) ClearCart

func (h *CartHandler) ClearCart(w http.ResponseWriter, r *http.Request)

func (*CartHandler) GetCart

func (h *CartHandler) GetCart(w http.ResponseWriter, r *http.Request)

func (*CartHandler) MiddlewareAuth

func (h *CartHandler) MiddlewareAuth(next http.Handler) http.Handler

func (*CartHandler) MiddlewareValidateCartItem

func (h *CartHandler) MiddlewareValidateCartItem(next http.Handler) http.Handler

func (*CartHandler) RemoveItem

func (h *CartHandler) RemoveItem(w http.ResponseWriter, r *http.Request)

func (*CartHandler) UpdateCartItemQuantity

func (h *CartHandler) UpdateCartItemQuantity(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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