Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RespondWithError ¶
func RespondWithError(w http.ResponseWriter, code int, message string)
RespondWithError is a function structure that errors
func RespondWithJSON ¶
func RespondWithJSON(w http.ResponseWriter, code int, payload interface{})
RespondWithJSON is a function that response values in json structure for http paltform
Types ¶
type Controller ¶
type Controller struct{}
Controller his a empty struct to append controller functions
type ProductController ¶
ProductController has a struct to controller product
func (*ProductController) CreateProduct ¶
func (c *ProductController) CreateProduct(w http.ResponseWriter, r *http.Request)
CreateProduct is a handler to create row in products
func (*ProductController) GetProduct ¶
func (c *ProductController) GetProduct(w http.ResponseWriter, r *http.Request)
GetProduct has a controller to return profducts
func (*ProductController) GetProducts ¶
func (c *ProductController) GetProducts(w http.ResponseWriter, r *http.Request)
GetProducts has a controller for get all products
Click to show internal directories.
Click to hide internal directories.