pg

package
v0.0.0-...-f15602e Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package pg contains implementations for product repositories

Index

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

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) Delete

func (r ProductRepository) Delete(ctx context.Context, filter *product.Filter) error

Delete product in db.

func (ProductRepository) Get

Get product from db.

func (ProductRepository) Query

Query products from db.

func (ProductRepository) Update

func (r ProductRepository) Update(
	ctx context.Context,
	productID product.ID,
	props *product.Props,
) (*product.Product, error)

Update product in db.

Jump to

Keyboard shortcuts

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