queries

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: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGetProductByIdHandler

func NewGetProductByIdHandler(log logger.Logger, cfg *config.Config, mongoRepo repository.Repository, redisRepo repository.CacheRepository) *getProductByIdHandler

func NewSearchProductHandler

func NewSearchProductHandler(log logger.Logger, cfg *config.Config, mongoRepo repository.Repository, redisRepo repository.CacheRepository) *searchProductHandler

Types

type GetProductByIdHandler

type GetProductByIdHandler interface {
	Handle(ctx context.Context, query *GetProductByIdQuery) (*models.Product, error)
}

type GetProductByIdQuery

type GetProductByIdQuery struct {
	ProductID uuid.UUID `json:"productId" bson:"_id,omitempty"`
}

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) (*models.ProductsList, 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

Jump to

Keyboard shortcuts

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