Documentation ¶
Index ¶
- type ProductService
- func (s *ProductService) AddProduct(p *catalog.Product)
- func (s *ProductService) DeleteProduct(id int) (bool, *catalog.ProductError)
- func (s *ProductService) FindProduct(id int) (*catalog.Product, *catalog.ProductError)
- func (s *ProductService) GetProducts(offset int, limit int) (*catalog.ProductPage, *catalog.ProductError)
- func (s *ProductService) UpdateProduct(id int, p *catalog.Product) (bool, *catalog.ProductError)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProductService ¶
type ProductService struct {
// contains filtered or unexported fields
}
ProductService manages product business logic
func (*ProductService) AddProduct ¶
func (s *ProductService) AddProduct(p *catalog.Product)
AddProduct adds a product
func (*ProductService) DeleteProduct ¶
func (s *ProductService) DeleteProduct(id int) (bool, *catalog.ProductError)
DeleteProduct deletes a product
func (*ProductService) FindProduct ¶
func (s *ProductService) FindProduct(id int) (*catalog.Product, *catalog.ProductError)
FindProduct finds a product by id
func (*ProductService) GetProducts ¶
func (s *ProductService) GetProducts( offset int, limit int, ) (*catalog.ProductPage, *catalog.ProductError)
GetProducts obtains products in batches
func (*ProductService) UpdateProduct ¶
func (s *ProductService) UpdateProduct(id int, p *catalog.Product) (bool, *catalog.ProductError)
UpdateProduct updates a product
Click to show internal directories.
Click to hide internal directories.