handler

package
v0.0.0-...-a655b0a Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func HandlerWrapper

func HandlerWrapper(hf HandlerFn) http.HandlerFunc

handle http error

func JSONError

func JSONError(w http.ResponseWriter, err interface{}, code int)

Types

type HandlerFn

type HandlerFn func(r *http.Request) (interface{}, error)

type OrderCtlHandler

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

func NewOrderCtlHandler

func NewOrderCtlHandler(
	orderService *services.OrderService,
) *OrderCtlHandler

func (*OrderCtlHandler) AddOrder

func (o *OrderCtlHandler) AddOrder(
	req *http.Request,
) (interface{}, error)

func (*OrderCtlHandler) UpdateOrderStatus

func (o *OrderCtlHandler) UpdateOrderStatus(
	req *http.Request,
) (interface{}, error)

type ProductCtlHandler

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

func NewProductCtlHandler

func NewProductCtlHandler(
	ctlService *services.ProductCtlServices,
) *ProductCtlHandler

func (*ProductCtlHandler) AddProduct

func (p *ProductCtlHandler) AddProduct(
	req *http.Request,
) (interface{}, error)

func (*ProductCtlHandler) GetProduct

func (p *ProductCtlHandler) GetProduct(
	req *http.Request,
) (interface{}, error)

func (*ProductCtlHandler) ListProducts

func (p *ProductCtlHandler) ListProducts(
	req *http.Request,
) (interface{}, error)

Jump to

Keyboard shortcuts

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