categories

package
v0.0.0-...-6c8972c Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Permission

func Permission(ctx context.Context) map[string]storage.ResAct

Types

type CoreCategory

type CoreCategory interface {
	CreateCategory(context.Context, storage.Category) (string, error)
	GetCategoryByID(context.Context, string) (*storage.Category, error)
	UpdateCategory(context.Context, storage.Category) (*storage.Category, error)
	ListCategories(context.Context, storage.ListCategoryFilter) ([]storage.Category, error)
	DeleteCategory(context.Context, string, string) error
}

type Svc

type Svc struct {
	catG.UnimplementedCategoryServiceServer
	// contains filtered or unexported fields
}

func New

func New(cc CoreCategory, logger *logrus.Entry) *Svc

func (*Svc) CreateCategory

func (s *Svc) CreateCategory(ctx context.Context, req *catG.CreateCategoryRequest) (*catG.CreateCategoryResponse, error)

func (*Svc) DeleteCategory

func (s *Svc) DeleteCategory(ctx context.Context, req *catG.DeleteCategoryRequest) (*emptypb.Empty, error)

func (*Svc) GetCategory

func (s *Svc) GetCategory(ctx context.Context, req *catG.GetCategoryRequest) (*catG.GetCategoryResponse, error)

func (*Svc) ListCategory

func (s *Svc) ListCategory(ctx context.Context, req *catG.ListCategoryRequest) (*catG.ListCategoryResponse, error)

func (*Svc) RegisterSvc

func (h *Svc) RegisterSvc(srv *grpc.Server) error

// RegisterService with grpc server.

func (*Svc) UpdateCategory

func (s *Svc) UpdateCategory(ctx context.Context, req *catG.UpdateCategoryRequest) (*catG.UpdateCategoryResponse, error)

func (*Svc) ValidateRequestedData

func (s *Svc) ValidateRequestedData(ctx context.Context, req storage.Category, id string) error

Jump to

Keyboard shortcuts

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