Documentation ¶
Overview ¶
Package pg contains implementations for category repositories
Index ¶
- type CategoryRepository
- func (r *CategoryRepository) Create(ctx context.Context, props *category.Props) (*category.Category, error)
- func (r *CategoryRepository) Delete(ctx context.Context, id category.ID) error
- func (r *CategoryRepository) Get(ctx context.Context, filter *category.Filter) (*category.Category, error)
- func (r *CategoryRepository) Query(ctx context.Context, criteria *category.QueryCriteria) (category.Categories, error)
- func (r *CategoryRepository) Update(ctx context.Context, id category.ID, props *category.Props) (*category.Category, error)
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) Get ¶
func (r *CategoryRepository) Get( ctx context.Context, filter *category.Filter, ) (*category.Category, error)
Get category from db.
func (*CategoryRepository) Query ¶
func (r *CategoryRepository) Query( ctx context.Context, criteria *category.QueryCriteria, ) (category.Categories, error)
Query categories from db based on criteria.
Click to show internal directories.
Click to hide internal directories.