Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrorProductNotFound = fmt.Errorf("Product not found")
Functions ¶
func AddProduct ¶
func AddProduct(p *Product)
func DeleteProduct ¶
func UpdateProduct ¶
Types ¶
type Product ¶
type Product struct { // the id for the product // //requred: false // min: 1 ID int `json:"id"` // The name for the product // // requred: true // max length: 255 Name string `json:"name" validate:"required"` // The description of the product // // required: true //max length: 10000 Description string `json:"description" validate:"required"` // requred: true // min:0.01 Price float32 `json:"price" validate:"required,gte=0,lte=10000"` // The sku for the product // // requred:true // pattern:[a-z]+-[a-z]+-[1-9] SKU string `json:"sku" validate:"required,sku"` CreatedAt string `json:"-"` UpdatedAt string `json:"-"` DeletedAt string `json:"-"` }
Product defines the structure for an API Product swagger:model
Click to show internal directories.
Click to hide internal directories.