repositories

package
v0.0.0-...-daa638b Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttributeRepository

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

func NewAttributeRepository

func NewAttributeRepository(dbConn *pgxpool.Pool) *AttributeRepository

func (*AttributeRepository) Create

func (*AttributeRepository) Delete

func (r *AttributeRepository) Delete(ctx context.Context, id int) error

func (*AttributeRepository) Fetch

func (r *AttributeRepository) Fetch(ctx context.Context, page int, size int, sortBy string, orderBy string) (*entities.AttributePaginated, error)

func (*AttributeRepository) GetByID

func (r *AttributeRepository) GetByID(ctx context.Context, id int) (res *entities.Attribute, err error)

func (*AttributeRepository) Search

func (r *AttributeRepository) Search(ctx context.Context, q string, page int, size int, sortBy string, orderBy string) (*entities.AttributePaginated, error)

func (*AttributeRepository) Update

type CategoryRepository

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

func NewCategoryRepository

func NewCategoryRepository(dbConn *pgxpool.Pool) *CategoryRepository

func (*CategoryRepository) Create

func (*CategoryRepository) Delete

func (r *CategoryRepository) Delete(ctx context.Context, id int) error

func (*CategoryRepository) Fetch

func (r *CategoryRepository) Fetch(ctx context.Context, page int, size int, sortBy string, orderBy string) (*entities.CategoryPaginated, error)

func (*CategoryRepository) GetByID

func (r *CategoryRepository) GetByID(ctx context.Context, id int) (res *entities.Category, err error)

func (*CategoryRepository) GetProducts

func (r *CategoryRepository) GetProducts(ctx context.Context, id int, page int, size int, sortBy string, orderBy string) (*entities.CategoryProductsPaginated, error)

func (*CategoryRepository) Search

func (r *CategoryRepository) Search(ctx context.Context, q string, page int, size int, sortBy string, orderBy string) (*entities.CategoryPaginated, error)

func (*CategoryRepository) Update

type ImageRepository

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

func NewImageRepository

func NewImageRepository(dbConn *pgxpool.Pool) *ImageRepository

func (*ImageRepository) Create

func (r *ImageRepository) Create(ctx context.Context, dto *dtos.CreateImageDto) (int, error)

func (*ImageRepository) Delete

func (r *ImageRepository) Delete(ctx context.Context, id int) (string, error)

func (*ImageRepository) Update

func (r *ImageRepository) Update(ctx context.Context, dto *dtos.UpdateImageDto) error

type ProductRepository

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

func NewProductRepository

func NewProductRepository(dbConn *pgxpool.Pool) *ProductRepository

func (*ProductRepository) AddAttribute

func (*ProductRepository) AddImage

func (r *ProductRepository) AddImage(ctx context.Context, id int, imageID int) error

func (*ProductRepository) Create

func (*ProductRepository) CreateVariant

func (r *ProductRepository) CreateVariant(ctx context.Context, dto *dtos.CreateProductVariantDto) error

func (*ProductRepository) Delete

func (r *ProductRepository) Delete(ctx context.Context, id int) error

func (*ProductRepository) DeleteVariant

func (r *ProductRepository) DeleteVariant(ctx context.Context, id int, variantID int) error

func (*ProductRepository) Fetch

func (r *ProductRepository) Fetch(ctx context.Context, page int, size int, sortBy string, orderBy string) (*entities.ProductPaginated, error)

func (*ProductRepository) FetchVariants

func (r *ProductRepository) FetchVariants(ctx context.Context, id int, page int, size int, sortBy string, orderBy string) (*entities.ProductVariantPaginated, error)

func (*ProductRepository) GetAttributes

func (r *ProductRepository) GetAttributes(ctx context.Context, id int, variantID int) ([]*entities.Attribute, error)

func (*ProductRepository) GetByID

func (r *ProductRepository) GetByID(ctx context.Context, id int) (*entities.Product, error)

func (*ProductRepository) GetImages

func (r *ProductRepository) GetImages(ctx context.Context, id int) ([]*entities.Image, error)

func (*ProductRepository) GetVariantByID

func (r *ProductRepository) GetVariantByID(ctx context.Context, id int, variantID int) (*entities.ProductVariant, error)

func (*ProductRepository) RemoveAttribute

func (r *ProductRepository) RemoveAttribute(ctx context.Context, id int, variantID int, attributeID int) error

func (*ProductRepository) RemoveImage

func (r *ProductRepository) RemoveImage(ctx context.Context, id int, imageID int) error

func (*ProductRepository) Search

func (r *ProductRepository) Search(ctx context.Context, q string, page int, size int, sortBy string, orderBy string) (*entities.ProductPaginated, error)

func (*ProductRepository) SearchVariants

func (r *ProductRepository) SearchVariants(ctx context.Context, q string, id int, page int, size int, sortBy string, orderBy string, attrs []*dtos.AttributeSearchQueryDto) (*entities.ProductVariantPaginated, error)

func (*ProductRepository) Update

func (*ProductRepository) UpdateVariant

func (r *ProductRepository) UpdateVariant(ctx context.Context, dto *dtos.UpdateProductVariantDto) error

type UserRepository

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

func NewUserRepository

func NewUserRepository(dbConn *pgxpool.Pool) *UserRepository

func (*UserRepository) ChangePassword

func (r *UserRepository) ChangePassword(ctx context.Context, username string, dto *dtos.ChangePasswordDto) error

func (*UserRepository) ChangeUsername

func (r *UserRepository) ChangeUsername(ctx context.Context, username string, dto *dtos.ChangeUsernameDto) error

func (*UserRepository) Create

func (r *UserRepository) Create(ctx context.Context, dto *dtos.SignupDto) error

func (*UserRepository) Delete

func (r *UserRepository) Delete(ctx context.Context, username string) error

func (*UserRepository) GetByUsername

func (r *UserRepository) GetByUsername(ctx context.Context, username string) (res *entities.User, err error)

Jump to

Keyboard shortcuts

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