Documentation
¶
Overview ¶
Package classification of Product API
Documentation for Product API
Schemes: http BasePath: / Version: 1.0.0 Consumes: - application/json Produces: - application/json
swagger:meta
Index ¶
- type GenericError
- type KeyProduct
- type Products
- func (p *Products) AddProduct(rw http.ResponseWriter, r *http.Request)
- func (p *Products) DeleteProduct(rw http.ResponseWriter, r *http.Request)
- func (p *Products) GetProduct(rw http.ResponseWriter, r *http.Request)
- func (p *Products) GetProducts(rw http.ResponseWriter, r *http.Request)
- func (p Products) MiddlewareValidateProduct(next http.Handler) http.Handler
- func (p Products) UpdateProducts(rw http.ResponseWriter, r *http.Request)
- type ValidationError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GenericError ¶
type GenericError struct {
Message string `json:"message"`
}
GenericError is a generic error message returned by a server
type KeyProduct ¶
type KeyProduct struct{}
type Products ¶
type Products struct {
// contains filtered or unexported fields
}
Products is a http.Handler
func NewProducts ¶
NewProducts creates a Products handler with the given logger
func (*Products) AddProduct ¶
func (p *Products) AddProduct(rw http.ResponseWriter, r *http.Request)
AddProduct adds a product to the data store.
func (*Products) DeleteProduct ¶
func (p *Products) DeleteProduct(rw http.ResponseWriter, r *http.Request)
DeleteProduct deletes a product from the data store.
func (*Products) GetProduct ¶
func (p *Products) GetProduct(rw http.ResponseWriter, r *http.Request)
GetProduct handles GET requests and returns a product.
func (*Products) GetProducts ¶
func (p *Products) GetProducts(rw http.ResponseWriter, r *http.Request)
GetProducts handles GET requests and returns all current products.
func (Products) MiddlewareValidateProduct ¶
func (Products) UpdateProducts ¶
func (p Products) UpdateProducts(rw http.ResponseWriter, r *http.Request)
UpdateProducts replaces the Product with a matching id.
type ValidationError ¶
type ValidationError struct {
Messages []string `json:"messages"`
}
ValidationError is a collection of validation error messages
Click to show internal directories.
Click to hide internal directories.