handlers

package
v0.0.0-...-5037bb9 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileServerWith404

func FileServerWith404(root http.FileSystem, handler404 FSHandler404) http.Handler

func FileSystem404

func FileSystem404(w http.ResponseWriter, r *http.Request) (doDefaultFileServe bool)

Types

type AppHandlers

type AppHandlers struct {
	Handlers    []HandlerI
	UserHandler *UserHandler
}

func InitHandlers

func InitHandlers(ctx context.Context, cfg *conf.Config, db *sql.DB) *AppHandlers

func NewAppHandlers

func NewAppHandlers(userHandler *UserHandler, handlers ...HandlerI) *AppHandlers

func (*AppHandlers) InitRoutes

func (h *AppHandlers) InitRoutes() http.Handler

func (*AppHandlers) MethodDispatcher

func (h *AppHandlers) MethodDispatcher(methods Methods) http.Handler

type CartHandler

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

func NewCartHandler

func NewCartHandler(cfg *conf.ConfigToken, logger *yolo_log.Logger, repo db_repository.CartRepositoryI) *CartHandler

func (*CartHandler) Create

func (h *CartHandler) Create(w http.ResponseWriter, req *http.Request)

func (*CartHandler) CreateProduct

func (h *CartHandler) CreateProduct(w http.ResponseWriter, req *http.Request)

func (*CartHandler) DeleteAll

func (h *CartHandler) DeleteAll(w http.ResponseWriter, req *http.Request)

func (*CartHandler) DeleteProduct

func (h *CartHandler) DeleteProduct(w http.ResponseWriter, req *http.Request)

func (*CartHandler) GetAll

func (h *CartHandler) GetAll(w http.ResponseWriter, req *http.Request)

func (*CartHandler) RegisterRoutes

func (h *CartHandler) RegisterRoutes(r *http.ServeMux, appH *AppHandlers)

func (*CartHandler) Update

func (h *CartHandler) Update(w http.ResponseWriter, req *http.Request)

type FSHandler404

type FSHandler404 = func(w http.ResponseWriter, r *http.Request) (doDefaultFileServe bool)

type HandlerI

type HandlerI interface {
	RegisterRoutes(router *http.ServeMux, h *AppHandlers)
}

type Methods

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

type OrderHandler

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

func NewOrderHandler

func NewOrderHandler(cfg *conf.ConfigToken, logger *yolo_log.Logger, repo db_repository.OrderRepositoryI) *OrderHandler

func (*OrderHandler) Create

func (h *OrderHandler) Create(w http.ResponseWriter, req *http.Request)

func (*OrderHandler) GetAll

func (h *OrderHandler) GetAll(w http.ResponseWriter, req *http.Request)

func (*OrderHandler) RegisterRoutes

func (h *OrderHandler) RegisterRoutes(r *http.ServeMux, appH *AppHandlers)

type ProductHandler

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

func NewProductHandler

func NewProductHandler(logger *yolo_log.Logger, repo db_repository.ProductRepositoryI) *ProductHandler

func (*ProductHandler) Create

func (h *ProductHandler) Create(w http.ResponseWriter, req *http.Request)

func (*ProductHandler) GetAll

func (h *ProductHandler) GetAll(w http.ResponseWriter, req *http.Request)

func (*ProductHandler) GetTypes

func (h *ProductHandler) GetTypes(w http.ResponseWriter, req *http.Request)

func (*ProductHandler) GetTypesBySupplier

func (h *ProductHandler) GetTypesBySupplier(w http.ResponseWriter, req *http.Request)

func (*ProductHandler) RegisterRoutes

func (h *ProductHandler) RegisterRoutes(r *http.ServeMux, appH *AppHandlers)

type StaticHandler

type StaticHandler struct {
}

func NewStaticHandler

func NewStaticHandler() *StaticHandler

func (*StaticHandler) RegisterRoutes

func (h *StaticHandler) RegisterRoutes(r *http.ServeMux, appH *AppHandlers)

type SupplierHandler

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

func (*SupplierHandler) Create

func (h *SupplierHandler) Create(w http.ResponseWriter, req *http.Request)

func (*SupplierHandler) GetAll

func (h *SupplierHandler) GetAll(w http.ResponseWriter, req *http.Request)

func (*SupplierHandler) GetTypes

func (h *SupplierHandler) GetTypes(w http.ResponseWriter, req *http.Request)

func (*SupplierHandler) RegisterRoutes

func (h *SupplierHandler) RegisterRoutes(r *http.ServeMux, appH *AppHandlers)

type UserHandler

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

func (*UserHandler) AuthMiddleware

func (h *UserHandler) AuthMiddleware(handler http.Handler) http.Handler

func (*UserHandler) Create

func (h *UserHandler) Create(w http.ResponseWriter, req *http.Request)

func (*UserHandler) GetProfile

func (h *UserHandler) GetProfile(w http.ResponseWriter, req *http.Request)

func (*UserHandler) IsValid

func (h *UserHandler) IsValid(w http.ResponseWriter, req *http.Request)

func (*UserHandler) Login

func (h *UserHandler) Login(w http.ResponseWriter, req *http.Request)

func (*UserHandler) Logout

func (h *UserHandler) Logout(w http.ResponseWriter, req *http.Request)

func (*UserHandler) Refresh

func (h *UserHandler) Refresh(w http.ResponseWriter, req *http.Request)

func (*UserHandler) RegisterRoutes

func (h *UserHandler) RegisterRoutes(r *http.ServeMux, appH *AppHandlers)

type UserHandlerMock

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

func NewUserHandlerMock

func NewUserHandlerMock(cfg *conf.ConfigToken, logger *log.Logger, userRepo db_repository.UserRepositoryI, tokenRepo db_repository.TokensRepositoryI) *UserHandlerMock

func (*UserHandlerMock) GetProfile

func (h *UserHandlerMock) GetProfile(w http.ResponseWriter, req *http.Request)

func (*UserHandlerMock) RegisterRoutes

func (h *UserHandlerMock) RegisterRoutes(r *http.ServeMux, appH *AppHandlers)

Jump to

Keyboard shortcuts

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