Documentation ¶
Index ¶
- func FileServerWith404(root http.FileSystem, handler404 FSHandler404) http.Handler
- func FileSystem404(w http.ResponseWriter, r *http.Request) (doDefaultFileServe bool)
- type AppHandlers
- type CartHandler
- func (h *CartHandler) Create(w http.ResponseWriter, req *http.Request)
- func (h *CartHandler) CreateProduct(w http.ResponseWriter, req *http.Request)
- func (h *CartHandler) DeleteAll(w http.ResponseWriter, req *http.Request)
- func (h *CartHandler) DeleteProduct(w http.ResponseWriter, req *http.Request)
- func (h *CartHandler) GetAll(w http.ResponseWriter, req *http.Request)
- func (h *CartHandler) RegisterRoutes(r *http.ServeMux, appH *AppHandlers)
- func (h *CartHandler) Update(w http.ResponseWriter, req *http.Request)
- type FSHandler404
- type HandlerI
- type Methods
- type OrderHandler
- type ProductHandler
- func (h *ProductHandler) Create(w http.ResponseWriter, req *http.Request)
- func (h *ProductHandler) GetAll(w http.ResponseWriter, req *http.Request)
- func (h *ProductHandler) GetTypes(w http.ResponseWriter, req *http.Request)
- func (h *ProductHandler) GetTypesBySupplier(w http.ResponseWriter, req *http.Request)
- func (h *ProductHandler) RegisterRoutes(r *http.ServeMux, appH *AppHandlers)
- type StaticHandler
- type SupplierHandler
- func (h *SupplierHandler) Create(w http.ResponseWriter, req *http.Request)
- func (h *SupplierHandler) GetAll(w http.ResponseWriter, req *http.Request)
- func (h *SupplierHandler) GetTypes(w http.ResponseWriter, req *http.Request)
- func (h *SupplierHandler) RegisterRoutes(r *http.ServeMux, appH *AppHandlers)
- type UserHandler
- func (h *UserHandler) AuthMiddleware(handler http.Handler) http.Handler
- func (h *UserHandler) Create(w http.ResponseWriter, req *http.Request)
- func (h *UserHandler) GetProfile(w http.ResponseWriter, req *http.Request)
- func (h *UserHandler) IsValid(w http.ResponseWriter, req *http.Request)
- func (h *UserHandler) Login(w http.ResponseWriter, req *http.Request)
- func (h *UserHandler) Logout(w http.ResponseWriter, req *http.Request)
- func (h *UserHandler) Refresh(w http.ResponseWriter, req *http.Request)
- func (h *UserHandler) RegisterRoutes(r *http.ServeMux, appH *AppHandlers)
- type UserHandlerMock
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 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 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 NewSupplierHandler ¶
func NewSupplierHandler(logger *yolo_log.Logger, repo db_repository.SupplierRepositoryI) *SupplierHandler
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 NewUserHandler ¶
func NewUserHandler(cfg *conf.ConfigToken, logger *yolo_log.Logger, userRepo db_repository.UserRepositoryI, tokenRepo db_repository.TokensRepositoryI) *UserHandler
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)
Click to show internal directories.
Click to hide internal directories.