productcatalogservice

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NotFoundError

type NotFoundError struct{}

func (NotFoundError) Error

func (e NotFoundError) Error() string

type Product

type Product struct {
	weaver.AutoMarshal
	ID          string  `json:"id"`
	Name        string  `json:"name"`
	Description string  `json:"description"`
	Picture     string  `json:"picture"`
	PriceUSD    money.T `json:"priceUsd"`

	// Categories such as "clothing" or "kitchen" that can be used to look up
	// other related products.
	Categories []string `json:"categories"`
}

func (*Product) WeaverMarshal

func (x *Product) WeaverMarshal(enc *codegen.Encoder)

func (*Product) WeaverUnmarshal

func (x *Product) WeaverUnmarshal(dec *codegen.Decoder)

type T

type T interface {
	ListProducts(ctx context.Context) ([]Product, error)
	GetProduct(ctx context.Context, productID string) (Product, error)
	SearchProducts(ctx context.Context, query string) ([]Product, error)
}

Jump to

Keyboard shortcuts

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