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: 8 Imported by: 0

Documentation

Overview

Package pg contains implementations for category repositories

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CategoryRepository

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

CategoryRepository pg repository implementation.

func NewCategoryRepository

func NewCategoryRepository(client *ent.Client, logger *zap.Logger) *CategoryRepository

NewCategoryRepository create instance of CategoryRepository.

func (*CategoryRepository) Create

func (r *CategoryRepository) Create(
	ctx context.Context,
	props *category.Props,
) (*category.Category, error)

Create category in db.

func (*CategoryRepository) Delete

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

Delete category in db.

func (*CategoryRepository) Get

Get category from db.

func (*CategoryRepository) Query

Query categories from db based on criteria.

func (*CategoryRepository) Update

func (r *CategoryRepository) Update(
	ctx context.Context,
	id category.ID,
	props *category.Props,
) (*category.Category, error)

Update category in db.

Jump to

Keyboard shortcuts

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