commands

package
v0.0.0-...-358e048 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCreateProductHandler

func NewCreateProductHandler(log logger.Logger, cfg *config.Config, kafkaProducer kafkaClient.Producer) *createProductHandler

func NewDeleteProductHandler

func NewDeleteProductHandler(log logger.Logger, cfg *config.Config, kafkaProducer kafkaClient.Producer) *deleteProductHandler

func NewUpdateProductHandler

func NewUpdateProductHandler(log logger.Logger, cfg *config.Config, kafkaProducer kafkaClient.Producer) *updateProductCmdHandler

Types

type CreateProductCmdHandler

type CreateProductCmdHandler interface {
	Handle(ctx context.Context, command *CreateProductCommand) error
}

type CreateProductCommand

type CreateProductCommand struct {
	CreateDto *dto.CreateProductDto
}

func NewCreateProductCommand

func NewCreateProductCommand(createDto *dto.CreateProductDto) *CreateProductCommand

type DeleteProductCmdHandler

type DeleteProductCmdHandler interface {
	Handle(ctx context.Context, command *DeleteProductCommand) error
}

type DeleteProductCommand

type DeleteProductCommand struct {
	ProductID uuid.UUID `json:"productId" validate:"required"`
}

func NewDeleteProductCommand

func NewDeleteProductCommand(productID uuid.UUID) *DeleteProductCommand

type ProductCommands

type ProductCommands struct {
	CreateProduct CreateProductCmdHandler
	UpdateProduct UpdateProductCmdHandler
	DeleteProduct DeleteProductCmdHandler
}

func NewProductCommands

func NewProductCommands(createProduct CreateProductCmdHandler, updateProduct UpdateProductCmdHandler, deleteProduct DeleteProductCmdHandler) *ProductCommands

type UpdateProductCmdHandler

type UpdateProductCmdHandler interface {
	Handle(ctx context.Context, command *UpdateProductCommand) error
}

type UpdateProductCommand

type UpdateProductCommand struct {
	UpdateDto *dto.UpdateProductDto
}

func NewUpdateProductCommand

func NewUpdateProductCommand(updateDto *dto.UpdateProductDto) *UpdateProductCommand

Jump to

Keyboard shortcuts

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