product

package
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(repository adapter.Interface) handlers.Interface

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) Get

func (h *Handler) Get(w http.ResponseWriter, r *http.Request)

func (*Handler) Options

func (h *Handler) Options(w http.ResponseWriter, r *http.Request)

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]

Jump to

Keyboard shortcuts

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