Documentation
¶
Overview ¶
Package pg contains implementations for product repositories
Index ¶
- type ImageRepository
- func (r *ImageRepository) BulkCreate(ctx context.Context, images product.Images) (product.Images, error)
- func (r *ImageRepository) Delete(ctx context.Context, filter *product.ImageFilter) error
- func (r *ImageRepository) Get(ctx context.Context, filter *product.ImageFilter) (*product.Image, error)
- func (r *ImageRepository) Query(ctx context.Context, criteria *product.ImageQueryCriteria) (product.Images, error)
- type ProductRepository
- func (r ProductRepository) Create(ctx context.Context, props *product.Props) (*product.Product, error)
- func (r ProductRepository) Delete(ctx context.Context, filter *product.Filter) error
- func (r ProductRepository) Get(ctx context.Context, filter *product.Filter) (*product.Product, error)
- func (r ProductRepository) Query(ctx context.Context, criteria *product.QueryCriteria) (*product.QueryResult, error)
- func (r ProductRepository) Update(ctx context.Context, productID product.ID, props *product.Props) (*product.Product, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ImageRepository ¶
type ImageRepository struct {
// contains filtered or unexported fields
}
ImageRepository pg repository implementation.
func NewImageRepository ¶
func NewImageRepository(client *ent.Client, logger *zap.Logger) *ImageRepository
NewImageRepository create instance of ImageRepository.
func (*ImageRepository) BulkCreate ¶
func (r *ImageRepository) BulkCreate( ctx context.Context, images product.Images, ) (product.Images, error)
BulkCreate create product images in db with transaction.
func (*ImageRepository) Delete ¶
func (r *ImageRepository) Delete(ctx context.Context, filter *product.ImageFilter) error
Delete delete product images in db.
func (*ImageRepository) Get ¶
func (r *ImageRepository) Get( ctx context.Context, filter *product.ImageFilter, ) (*product.Image, error)
Get product image from db.
func (*ImageRepository) Query ¶
func (r *ImageRepository) Query( ctx context.Context, criteria *product.ImageQueryCriteria, ) (product.Images, error)
Query product images from db.
type ProductRepository ¶
type ProductRepository struct {
// contains filtered or unexported fields
}
ProductRepository pg repository implementation.
func NewProductRepository ¶
func NewProductRepository(client *ent.Client, logger *zap.Logger) *ProductRepository
NewProductRepository create instance of ProductRepository.
func (ProductRepository) Create ¶
func (r ProductRepository) Create( ctx context.Context, props *product.Props, ) (*product.Product, error)
Create product in db.
func (ProductRepository) Get ¶
func (r ProductRepository) Get(ctx context.Context, filter *product.Filter) (*product.Product, error)
Get product from db.
func (ProductRepository) Query ¶
func (r ProductRepository) Query( ctx context.Context, criteria *product.QueryCriteria, ) (*product.QueryResult, error)
Query products from db.
Click to show internal directories.
Click to hide internal directories.