Documentation ¶
Index ¶
- type Product
- type ProductCreated
- type ProductDAO
- func (dao *ProductDAO) AddProduct(p *Product)
- func (dao *ProductDAO) DeleteProduct(id int) (bool, *ProductError)
- func (dao *ProductDAO) FindProduct(id int) (*Product, *ProductError)
- func (dao *ProductDAO) GetProducts(offset int, limit int) (*ProductPage, *ProductError)
- func (dao *ProductDAO) UpdateProduct(id int, p *Product) (bool, *ProductError)
- type ProductError
- type ProductPage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Product ¶
type Product struct { ID int `json:"id"` Name string `json:"name"` Price int `json:"price"` Color string `json:"color"` Size string `json:"size"` }
Product model
type ProductDAO ¶
type ProductDAO struct {
// contains filtered or unexported fields
}
ProductDAO access to product data
func (*ProductDAO) AddProduct ¶
func (dao *ProductDAO) AddProduct(p *Product)
AddProduct adds a product
func (*ProductDAO) DeleteProduct ¶
func (dao *ProductDAO) DeleteProduct(id int) (bool, *ProductError)
DeleteProduct deletes a product
func (*ProductDAO) FindProduct ¶
func (dao *ProductDAO) FindProduct(id int) (*Product, *ProductError)
FindProduct finds a product by id
func (*ProductDAO) GetProducts ¶
func (dao *ProductDAO) GetProducts(offset int, limit int) (*ProductPage, *ProductError)
GetProducts obtains products in batches
func (*ProductDAO) UpdateProduct ¶
func (dao *ProductDAO) UpdateProduct(id int, p *Product) (bool, *ProductError)
UpdateProduct updates a product
type ProductError ¶
ProductError model
func (*ProductError) Error ¶
func (err *ProductError) Error() string
type ProductPage ¶
ProductPage model
Click to show internal directories.
Click to hide internal directories.