service

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 27, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL