domain

package
v0.0.0-...-243c350 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CollectionProduct = "products"

	ProductPaint    = "paint"
	ProductWood     = "wood"
	ProductHardware = "hardware"
)

Variables

This section is empty.

Functions

func NewErrorWrapper

func NewErrorWrapper(code int, err error, message string) error

Types

type CustomErrorWrapper

type CustomErrorWrapper struct {
	Message string `json:"message"`
	Code    int    `json:"-"`
	Err     error  `json:"-"`
}

func (CustomErrorWrapper) Error

func (err CustomErrorWrapper) Error() string

func (CustomErrorWrapper) Unwrap

func (err CustomErrorWrapper) Unwrap() error

type Product

type Product struct {
	ID       primitive.ObjectID `json:"id"`
	Name     string             `json:"name"`
	Category string             `json:"category"`
	SKU      string             `json:"sku"`
}

type ProductRepository

type ProductRepository interface {
	Create(c context.Context, product *Product) error
	Get(c context.Context, filter string) ([]Product, error)
}

type ProductUsecase

type ProductUsecase interface {
	Create(c context.Context, product *Product) error
	Get(c context.Context, filter string) ([]Product, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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