Documentation
¶
Overview ¶
Package category contains product category oriented logic.
Package category is a generated GoMock package.
Package category is a generated GoMock package.
Index ¶
- type Categories
- type Category
- type Filter
- type ID
- type IDFilter
- type IDs
- type MockRepository
- func (m *MockRepository) Create(ctx context.Context, props *Props) (*Category, error)
- func (m *MockRepository) Delete(ctx context.Context, id ID) error
- func (m *MockRepository) EXPECT() *MockRepositoryMockRecorder
- func (m *MockRepository) Get(ctx context.Context, filter *Filter) (*Category, error)
- func (m *MockRepository) Query(ctx context.Context, criteria *QueryCriteria) (Categories, error)
- func (m *MockRepository) Update(ctx context.Context, id ID, props *Props) (*Category, error)
- type MockRepositoryMockRecorder
- func (mr *MockRepositoryMockRecorder) Create(ctx, props any) *gomock.Call
- func (mr *MockRepositoryMockRecorder) Delete(ctx, id any) *gomock.Call
- func (mr *MockRepositoryMockRecorder) Get(ctx, filter any) *gomock.Call
- func (mr *MockRepositoryMockRecorder) Query(ctx, criteria any) *gomock.Call
- func (mr *MockRepositoryMockRecorder) Update(ctx, id, props any) *gomock.Call
- type MockService
- func (m *MockService) Create(ctx context.Context, props *Props) (*Category, error)
- func (m *MockService) Delete(ctx context.Context, id ID) error
- func (m *MockService) EXPECT() *MockServiceMockRecorder
- func (m *MockService) Query(ctx context.Context, criteria *QueryCriteria) (Categories, error)
- func (m *MockService) Update(ctx context.Context, id ID, props *Props) (*Category, error)
- type MockServiceMockRecorder
- type NameFilter
- type Props
- type QueryCriteria
- type Repository
- type Service
- type UseCase
- func (s *UseCase) Create(ctx context.Context, props *Props) (*Category, error)
- func (s *UseCase) Delete(ctx context.Context, id ID) error
- func (s *UseCase) Query(ctx context.Context, criteria *QueryCriteria) (Categories, error)
- func (s *UseCase) Update(ctx context.Context, id ID, props *Props) (*Category, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockRepository ¶
type MockRepository struct {
// contains filtered or unexported fields
}
MockRepository is a mock of Repository interface.
func NewMockRepository ¶
func NewMockRepository(ctrl *gomock.Controller) *MockRepository
NewMockRepository creates a new mock instance.
func (*MockRepository) Delete ¶
func (m *MockRepository) Delete(ctx context.Context, id ID) error
Delete mocks base method.
func (*MockRepository) EXPECT ¶
func (m *MockRepository) EXPECT() *MockRepositoryMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockRepository) Query ¶
func (m *MockRepository) Query(ctx context.Context, criteria *QueryCriteria) (Categories, error)
Query mocks base method.
type MockRepositoryMockRecorder ¶
type MockRepositoryMockRecorder struct {
// contains filtered or unexported fields
}
MockRepositoryMockRecorder is the mock recorder for MockRepository.
func (*MockRepositoryMockRecorder) Create ¶
func (mr *MockRepositoryMockRecorder) Create(ctx, props any) *gomock.Call
Create indicates an expected call of Create.
func (*MockRepositoryMockRecorder) Delete ¶
func (mr *MockRepositoryMockRecorder) Delete(ctx, id any) *gomock.Call
Delete indicates an expected call of Delete.
func (*MockRepositoryMockRecorder) Get ¶
func (mr *MockRepositoryMockRecorder) Get(ctx, filter any) *gomock.Call
Get indicates an expected call of Get.
type MockService ¶
type MockService struct {
// contains filtered or unexported fields
}
MockService is a mock of Service interface.
func NewMockService ¶
func NewMockService(ctrl *gomock.Controller) *MockService
NewMockService creates a new mock instance.
func (*MockService) Delete ¶
func (m *MockService) Delete(ctx context.Context, id ID) error
Delete mocks base method.
func (*MockService) EXPECT ¶
func (m *MockService) EXPECT() *MockServiceMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockService) Query ¶
func (m *MockService) Query(ctx context.Context, criteria *QueryCriteria) (Categories, error)
Query mocks base method.
type MockServiceMockRecorder ¶
type MockServiceMockRecorder struct {
// contains filtered or unexported fields
}
MockServiceMockRecorder is the mock recorder for MockService.
func (*MockServiceMockRecorder) Create ¶
func (mr *MockServiceMockRecorder) Create(ctx, props any) *gomock.Call
Create indicates an expected call of Create.
func (*MockServiceMockRecorder) Delete ¶
func (mr *MockServiceMockRecorder) Delete(ctx, id any) *gomock.Call
Delete indicates an expected call of Delete.
type NameFilter ¶
NameFilter represents name filter.
type QueryCriteria ¶
type QueryCriteria struct {
Filter Filter
}
QueryCriteria represents a criteria for category query.
type Repository ¶
type Repository interface { Create(ctx context.Context, props *Props) (*Category, error) Query(ctx context.Context, criteria *QueryCriteria) (Categories, error) Get(ctx context.Context, filter *Filter) (*Category, error) Update(ctx context.Context, id ID, props *Props) (*Category, error) Delete(ctx context.Context, id ID) error }
Repository represents category repository.
type Service ¶
type Service interface { Create(ctx context.Context, props *Props) (*Category, error) Query(ctx context.Context, criteria *QueryCriteria) (Categories, error) Update(ctx context.Context, id ID, props *Props) (*Category, error) Delete(ctx context.Context, id ID) error }
Service represents category use cases.
type UseCase ¶
type UseCase struct {
// contains filtered or unexported fields
}
UseCase represents category service.
func NewUseCase ¶
func NewUseCase(categoryRepo Repository) *UseCase
NewUseCase create instance of UseCase.
func (*UseCase) Query ¶
func (s *UseCase) Query(ctx context.Context, criteria *QueryCriteria) (Categories, error)
Query categories.