Documentation
¶
Index ¶
- type S
- func (s *S) CreateCategory(ctx context.Context, req *categoryV1.CreateCategoryRequest) (*categoryV1.CreateCategoryResponse, error)
- func (s *S) DeleteCategory(ctx context.Context, req *categoryV1.DeleteCategoryRequest) (*categoryV1.DeleteCategoryResponse, error)
- func (s *S) GetCategory(ctx context.Context, req *categoryV1.GetCategoryRequest) (*categoryV1.GetCategoryResponse, error)
- func (s *S) GetCategoryList(ctx context.Context, req *categoryV1.GetCategoryListRequest) (*categoryV1.GetCategoryListResponse, error)
- func (s *S) UpdateCategory(ctx context.Context, req *categoryV1.UpdateCategoryRequest) (*categoryV1.UpdateCategoryResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type S ¶
type S struct { Log *zap.SugaredLogger categoryV1.UnimplementedCategoryServiceServer }
func (*S) CreateCategory ¶
func (s *S) CreateCategory(ctx context.Context, req *categoryV1.CreateCategoryRequest) (*categoryV1.CreateCategoryResponse, error)
CreateCategory creates a new category given a request context and a CreateCategoryRequest. It verifies the user's authentication, checks if the user is an admin, and then proceeds to create the category with its associated metadata. Returns a CreateCategoryResponse on success or an error otherwise.
func (*S) DeleteCategory ¶
func (s *S) DeleteCategory(ctx context.Context, req *categoryV1.DeleteCategoryRequest) (*categoryV1.DeleteCategoryResponse, error)
func (*S) GetCategory ¶
func (s *S) GetCategory(ctx context.Context, req *categoryV1.GetCategoryRequest) (*categoryV1.GetCategoryResponse, error)
GetCategory retrieves a single category by its ID, including its metadata, after ensuring the user is authenticated. It returns a GetCategoryResponse containing the category details or an error if the operation fails.
func (*S) GetCategoryList ¶
func (s *S) GetCategoryList(ctx context.Context, req *categoryV1.GetCategoryListRequest) (*categoryV1.GetCategoryListResponse, error)
func (*S) UpdateCategory ¶
func (s *S) UpdateCategory(ctx context.Context, req *categoryV1.UpdateCategoryRequest) (*categoryV1.UpdateCategoryResponse, error)
Click to show internal directories.
Click to hide internal directories.