Documentation ¶
Overview ¶
Package api containing API initialization and API route handler
Index ¶
- type API
- func (a *API) AddProductHandler(c *fiber.Ctx) error
- func (a *API) DecreaseStockHandler(c *fiber.Ctx) error
- func (a *API) DeleteProductHandler(c *fiber.Ctx) error
- func (a *API) GetProductHandler(c *fiber.Ctx) error
- func (a *API) GetProductsByUserIDHandler(c *fiber.Ctx) error
- func (a *API) GetProductsHandler(c *fiber.Ctx) error
- func (a *API) InitDB(DBConfig map[string]string) error
- func (a *API) InitRouter()
- func (a *API) UpdateProductHandler(c *fiber.Ctx) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
API contain database connection and router GoFiber for product service API
func (*API) AddProductHandler ¶
AddProductHandler handling route add product (method: POST, user: seller)
func (*API) DecreaseStockHandler ¶
DecreaseStockHandler handling route decrease product stock (method: PUT, user: seller)
func (*API) DeleteProductHandler ¶
DeleteProductHandler handling route delete product (method: DELETE, user: seller)
func (*API) GetProductHandler ¶
GetProductHandler handling route get one product by SKU (method: GET, user: all)
func (*API) GetProductsByUserIDHandler ¶
GetProductsByUserIDHandler handling route get products by user ID (method: GET, user: seller)
func (*API) GetProductsHandler ¶
GetProductsHandler handling route get products (method: GET, user: buyer)
func (*API) UpdateProductHandler ¶
UpdateProductHandler handling route update product (method: PUT, user: seller)