query

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrProductResourceNotFound  = errors.NewResourceNotFoundError("err.product.queryById.notFound", "resource not found")
	ErrCategoryResourceNotFound = errors.NewResourceNotFoundError("err.category.queryById.notFound", "resource not found")
)

Functions

This section is empty.

Types

type Category added in v1.5.0

type Category struct {
	ID   string
	Name string
}

type CategoryReadModelProjector added in v1.5.0

type CategoryReadModelProjector interface {
	LoadById(ctx context.Context, ID string) (Category, error)
}

type GetAllProductsHandler added in v1.6.0

type GetAllProductsHandler interface {
	Handle(ctx context.Context) (Products, error)
}

type GetAllProductsHandlerImpl added in v1.6.0

type GetAllProductsHandlerImpl struct {
	// contains filtered or unexported fields
}

func NewGetAllProductsHandlerImpl added in v1.6.0

func NewGetAllProductsHandlerImpl(projector ProductsReadModelQueryProjector) *GetAllProductsHandlerImpl

func (GetAllProductsHandlerImpl) Handle added in v1.6.0

type GetCategoryByIDHandler added in v1.5.0

type GetCategoryByIDHandler interface {
	Handle(ctx context.Context, id string) (Category, error)
}

type GetCategoryByIDHandlerImpl added in v1.5.0

type GetCategoryByIDHandlerImpl struct {
	// contains filtered or unexported fields
}

func NewGetCategoryByIDHandlerImpl added in v1.5.0

func NewGetCategoryByIDHandlerImpl(projector CategoryReadModelProjector) *GetCategoryByIDHandlerImpl

func (*GetCategoryByIDHandlerImpl) Handle added in v1.5.0

type GetProductByIDHandler

type GetProductByIDHandler interface {
	Handle(ctx context.Context, id string) (Product, error)
}

type GetProductByIDHandlerImpl

type GetProductByIDHandlerImpl struct {
	// contains filtered or unexported fields
}

func NewGetProductByIDHandlerImpl

func NewGetProductByIDHandlerImpl(projector ProductReadModelProjector) *GetProductByIDHandlerImpl

func (GetProductByIDHandlerImpl) Handle

type Product

type Product struct {
	ID       string
	Name     string
	Category string
	Variants []Variant
}

type ProductReadModelProjector

type ProductReadModelProjector interface {
	LoadById(ctx context.Context, id string) (Product, error)
}

type Products added in v1.6.0

type Products []Product

type ProductsReadModelQueryProjector added in v1.6.0

type ProductsReadModelQueryProjector interface {
	GetAllProducts(ctx context.Context) (Products, error)
}

type Variant

type Variant struct {
	ID    string
	Code  string
	Name  string
	Price float64
}

Jump to

Keyboard shortcuts

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