Documentation
¶
Index ¶
- type Products
- func (p *Products) AddProducts(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) UpdateProduct(rw http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Products ¶
type Products struct {
// contains filtered or unexported fields
}
func NewProducts ¶
func NewProducts(l hclog.Logger, pdb *data.ProductsDB) *Products
NewProducts returns a new instance of Products
func (*Products) AddProducts ¶
func (p *Products) AddProducts(rw http.ResponseWriter, r *http.Request)
AddProducts to the dataset
func (*Products) DeleteProduct ¶
func (p *Products) DeleteProduct(rw http.ResponseWriter, r *http.Request)
func (*Products) GetProduct ¶
func (p *Products) GetProduct(rw http.ResponseWriter, r *http.Request)
GetProduct returns a single product by its ID
func (*Products) GetProducts ¶
func (p *Products) GetProducts(rw http.ResponseWriter, r *http.Request)
swagger: route GET /products prodects listProducts Returns the list of all products response: 200 GetProducts return the products in the data store
func (*Products) UpdateProduct ¶
func (p *Products) UpdateProduct(rw http.ResponseWriter, r *http.Request)
UpdateProduct with new product passed in the reuqest body
Click to show internal directories.
Click to hide internal directories.