category

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package category provides business logic for category operations. It includes service layer functionality for category management with Redis caching.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CategoryService

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

func (*CategoryService) CreateCategory

func (s *CategoryService) CreateCategory(ctx context.Context, category model.CreateCategoryRequest) (int64, error)

func (*CategoryService) DeleteCategory

func (s *CategoryService) DeleteCategory(ctx context.Context, id int) error

func (*CategoryService) GetCategoryByID

func (s *CategoryService) GetCategoryByID(ctx context.Context, id int) (*sqlModel.Category, error)

func (*CategoryService) UpdateCategory

func (s *CategoryService) UpdateCategory(ctx context.Context, id int, category model.UpdateCategoryRequest) error

type CategoryServiceInterface

type CategoryServiceInterface interface {
	CreateCategory(ctx context.Context, category model.CreateCategoryRequest) (int64, error)
	GetCategoryByID(ctx context.Context, id int) (*sqlModel.Category, error)
	UpdateCategory(ctx context.Context, id int, category model.UpdateCategoryRequest) error
	DeleteCategory(ctx context.Context, id int) error
}

func NewCategoryService

func NewCategoryService(repo repository.DBRepository, logger *logger.Logger, cache *cache.Cache) CategoryServiceInterface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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