Documentation ¶
Index ¶
- func NewHandler(repository adapter.Interface) handlers.Interface
- type Handler
- func (h *Handler) Delete(w http.ResponseWriter, r *http.Request)
- func (h *Handler) Get(w http.ResponseWriter, r *http.Request)
- func (h *Handler) Options(w http.ResponseWriter, r *http.Request)
- func (h *Handler) Post(w http.ResponseWriter, r *http.Request)
- func (h *Handler) Put(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Handler ¶
type Handler struct { handlers.Interface Controller ControllersProduct.Interface Rules *RulesProduct.Rules }
func (*Handler) Delete ¶
func (h *Handler) Delete(w http.ResponseWriter, r *http.Request)
@Tags Product @Summary Delete an product @ID delete-product @Accept json @Produce json @Param ID path string true "ID of the product" @Success 204 @Failure 400 {object} http.ResponseError @Failure 404 {object} http.ResponseError @Failure 500 {object} http.ResponseError @Router /product/{ID} [delete]
func (*Handler) Post ¶
func (h *Handler) Post(w http.ResponseWriter, r *http.Request)
@Tags Product @Summary Create an product @ID post-product @Accept json @Produce json @Param product body product.RequestBodyToCreateOrUpdateProduct true "Body of add product" @Success 200 {object} product.ResponseCreateProduct @Failure 500 {object} http.ResponseError @Failure 400 {object} http.ResponseError @Router /product [post]
func (*Handler) Put ¶
func (h *Handler) Put(w http.ResponseWriter, r *http.Request)
@Tags Product @Summary Update an product @ID put-product @Accept json @Produce json @Param ID path string true "ID of the product" @Param product body product.RequestBodyToCreateOrUpdateProduct true "Body of update product" @Success 204 @Failure 400 {object} http.ResponseError @Failure 404 {object} http.ResponseError @Failure 500 {object} http.ResponseError @Router /product/{ID} [put]