biz

package
v0.0.0-...-da59240 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

ProviderSet is biz providers.

Functions

This section is empty.

Types

type Product

type Product struct {
	Id          string `db:"id"`
	Name        string `db:"name"`
	Description string `db:"description"`
	Price       int64  `db:"price"`
}

type ProductRepo

type ProductRepo interface {
	Save(context.Context, *Product) (*Product, error)
	Update(context.Context, string, *UpdateProduct) (*Product, error)
	FindByID(context.Context, string) (*Product, error)
	DeleteById(context.Context, string) (string, error)
	ListByHello(context.Context, string) ([]*Product, error)
	ListAll(context.Context) ([]*Product, error)
}

type ProductUsecase

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

func NewProductUsecase

func NewProductUsecase(repo ProductRepo, logger log.Logger) *ProductUsecase

func (*ProductUsecase) CreateProduct

func (uc *ProductUsecase) CreateProduct(ctx context.Context, g *Product) (*Product, error)

func (*ProductUsecase) DeleteById

func (uc *ProductUsecase) DeleteById(ctx context.Context, id string) (string, error)

func (*ProductUsecase) GetProduct

func (uc *ProductUsecase) GetProduct(ctx context.Context, id string) (*Product, error)

func (*ProductUsecase) Update

func (uc *ProductUsecase) Update(ctx context.Context, id string, p *UpdateProduct) (*Product, error)

type UpdateProduct

type UpdateProduct struct {
	Name        *string `db:"name"`
	Description *string `db:"description"`
	Price       *int64  `db:"price"`
}

Jump to

Keyboard shortcuts

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