Documentation ¶
Index ¶
- func NewGetProductByIdHandler(log logger.Logger, cfg *config.Config, ...) *getProductByIdHandler
- func NewSearchProductHandler(log logger.Logger, cfg *config.Config, ...) *searchProductHandler
- type GetProductByIdHandler
- type GetProductByIdQuery
- type ProductQueries
- type SearchProductHandler
- type SearchProductQuery
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGetProductByIdHandler ¶
func NewGetProductByIdHandler(log logger.Logger, cfg *config.Config, rsClient readerService.ReaderServiceClient) *getProductByIdHandler
func NewSearchProductHandler ¶
func NewSearchProductHandler(log logger.Logger, cfg *config.Config, rsClient readerService.ReaderServiceClient) *searchProductHandler
Types ¶
type GetProductByIdHandler ¶
type GetProductByIdHandler interface {
Handle(ctx context.Context, query *GetProductByIdQuery) (*dto.ProductResponse, error)
}
type GetProductByIdQuery ¶
type GetProductByIdQuery struct {
ProductID uuid.UUID `json:"productId" validate:"required,gte=0,lte=255"`
}
func NewGetProductByIdQuery ¶
func NewGetProductByIdQuery(productID uuid.UUID) *GetProductByIdQuery
type ProductQueries ¶
type ProductQueries struct { GetProductById GetProductByIdHandler SearchProduct SearchProductHandler }
func NewProductQueries ¶
func NewProductQueries(getProductById GetProductByIdHandler, searchProduct SearchProductHandler) *ProductQueries
type SearchProductHandler ¶
type SearchProductHandler interface {
Handle(ctx context.Context, query *SearchProductQuery) (*dto.ProductsListResponse, error)
}
type SearchProductQuery ¶
type SearchProductQuery struct { Text string `json:"text"` Pagination *utils.Pagination `json:"pagination"` }
func NewSearchProductQuery ¶
func NewSearchProductQuery(text string, pagination *utils.Pagination) *SearchProductQuery
Click to show internal directories.
Click to hide internal directories.