Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrProductNotFound = errors.New("product not found")
Functions ¶
func AddProduct ¶
func AddProduct(prod *Product)
func DeleteProduct ¶
func UpdateProduct ¶
Types ¶
type Product ¶
type Product struct { ID int `json:"id"` Name string `json:"name" validate:"required"` Description string `json:"description"` Price float32 `json:"price" validate:"gte=0"` SKU string `json:"sku" validate:"required, sku"` CreatedOn string `json:"-"` UpdatedOn string `json:"-"` DeleteOn string `json:"-"` }
Click to show internal directories.
Click to hide internal directories.