Documentation ¶
Index ¶
- Constants
- func ErrUnauthorized(w http.ResponseWriter, err error)
- type OrderApp
- type OrderHandler
- func (h *OrderHandler) CreateOrder(w http.ResponseWriter, r *http.Request)
- func (h *OrderHandler) GetOrder(w http.ResponseWriter, r *http.Request)
- func (h *OrderHandler) GetOrders(w http.ResponseWriter, r *http.Request)
- func (h *OrderHandler) MiddlewareAuth(next http.Handler) http.Handler
- func (h *OrderHandler) MiddlewareValidateOrderItems(next http.Handler) http.Handler
- func (h *OrderHandler) UpdateOrderStatus(w http.ResponseWriter, r *http.Request)
Constants ¶
View Source
const AuthCTXKey contextKey = "auth_token"
View Source
const OrderCTXKey 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 OrderApp ¶
type OrderApp struct {
// contains filtered or unexported fields
}
func NewOrderApp ¶
func NewOrderApp(s *service.OrderService, c *config.OrderConfig, log *zerolog.Logger) *OrderApp
type OrderHandler ¶
type OrderHandler struct {
// contains filtered or unexported fields
}
func NewOrderHandler ¶
func NewOrderHandler(s *service.OrderService, l *zerolog.Logger) *OrderHandler
func (*OrderHandler) CreateOrder ¶
func (h *OrderHandler) CreateOrder(w http.ResponseWriter, r *http.Request)
func (*OrderHandler) GetOrder ¶
func (h *OrderHandler) GetOrder(w http.ResponseWriter, r *http.Request)
func (*OrderHandler) GetOrders ¶
func (h *OrderHandler) GetOrders(w http.ResponseWriter, r *http.Request)
func (*OrderHandler) MiddlewareAuth ¶
func (h *OrderHandler) MiddlewareAuth(next http.Handler) http.Handler
func (*OrderHandler) MiddlewareValidateOrderItems ¶
func (h *OrderHandler) MiddlewareValidateOrderItems(next http.Handler) http.Handler
func (*OrderHandler) UpdateOrderStatus ¶
func (h *OrderHandler) UpdateOrderStatus(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.