repository

package
v0.0.0-...-2068963 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CategoryRepository

type CategoryRepository interface {
	CreateCategory(c context.Context, req *pb.Category) (*pb.Category, error)
	GetCategoryByID(c context.Context, req *pb.GetCategoryFilter) (*pb.GetCategoryResponse, error)
	GetCategories(c context.Context, req *pb.GetCategoryFilter) (*pb.GetCategoryResponse, error)
	UpdateCategory(c context.Context, req *pb.Category) (*pb.Category, error)
	DeleteCategory(c context.Context, req *pb.GetCategoryFilter) (*pb.DeleteCategoryResponse, error)
}

func NewCategoryRepository

func NewCategoryRepository(db Store, catQuery query.CategoryQuery) CategoryRepository

type ProductRepository

type ProductRepository interface {
	CreateProduct(c context.Context, product *pb.Product) (*pb.Product, error)
	GetProductByID(c context.Context, filter *pb.GetProductFilter) (*pb.GetProductResponse, error)
	GetAllProducts(c context.Context, filter *pb.GetProductFilter) (*pb.GetProductResponse, error)
	UpdateProduct(c context.Context, product *pb.Product) (*pb.Product, error)
	ApproveProduct(c context.Context, approve *pb.ApproveProductRequest) (*pb.ApproveProductResponse, error)
}

func NewProductRepository

func NewProductRepository(db Store, productQuery query.ProductQuery) ProductRepository

type Store

type Store interface {
	WithTx(ctx context.Context, fn func(pgx.Tx) error) error
	WithoutTx(ctx context.Context, fn func(*pgxpool.Pool) error) error
}

func NewStore

func NewStore(db *pgxpool.Pool) Store

type StoreImpl

type StoreImpl struct {
	Db *pgxpool.Pool
	// contains filtered or unexported fields
}

func (*StoreImpl) WithTx

func (s *StoreImpl) WithTx(ctx context.Context, fn func(pgx.Tx) error) error

func (*StoreImpl) WithoutTx

func (s *StoreImpl) WithoutTx(ctx context.Context, fn func(*pgxpool.Pool) error) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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