Documentation
¶
Index ¶
- Variables
- type EventRepo
- type ProductRepo
- type Service
- func (s *Service) CreateProduct(ctx context.Context, productDto dto.CreateProductCommand) (dto.Product, error)
- func (s *Service) DeleteProduct(ctx context.Context, productID uint64) (dto.Product, error)
- func (s *Service) GetProductById(ctx context.Context, id uint64) (dto.Product, error)
- func (s *Service) GetProducts(ctx context.Context) ([]dto.Product, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ProductNotFound = errors.New("products not found")
Functions ¶
This section is empty.
Types ¶
type ProductRepo ¶
type ProductRepo interface { AddProduct(ctx context.Context, product *model.Product, tx *sqlx.Tx) error GetProduct(ctx context.Context, productID uint64, tx *sqlx.Tx) (model.Product, error) ListProducts(ctx context.Context) ([]model.Product, error) RemoveProduct(ctx context.Context, productID uint64, tx *sqlx.Tx) error }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService( productRepo ProductRepo, eventRepo EventRepo, db *sqlx.DB) *Service
func (*Service) CreateProduct ¶
func (*Service) DeleteProduct ¶
func (*Service) GetProductById ¶
Click to show internal directories.
Click to hide internal directories.