Documentation ¶
Overview ¶
Package userpacks is a generated GoMock package.
Index ¶
- Variables
- type GormService
- func (s *GormService) Attach(ctx context.Context, params model.UserPackParams) error
- func (s *GormService) Drop(ctx context.Context, params model.UserPackParams) error
- func (s *GormService) List(ctx context.Context, params model.UserPackParams) ([]*model.UserPack, int64, error)
- func (s *GormService) Permit(ctx context.Context, params model.UserPackParams) error
- func (s *GormService) WithPrincipal(principal *model.User) Service
- type MockService
- func (m *MockService) Attach(arg0 context.Context, arg1 model.UserPackParams) error
- func (m *MockService) Drop(arg0 context.Context, arg1 model.UserPackParams) error
- func (m *MockService) EXPECT() *MockServiceMockRecorder
- func (m *MockService) List(arg0 context.Context, arg1 model.UserPackParams) ([]*model.UserPack, int64, error)
- func (m *MockService) Permit(arg0 context.Context, arg1 model.UserPackParams) error
- func (m *MockService) WithPrincipal(arg0 *model.User) Service
- type MockServiceMockRecorder
- func (mr *MockServiceMockRecorder) Attach(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockServiceMockRecorder) Drop(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockServiceMockRecorder) List(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockServiceMockRecorder) Permit(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockServiceMockRecorder) WithPrincipal(arg0 interface{}) *gomock.Call
- type Service
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidListParams defines the error if list receives invalid params. ErrInvalidListParams = errors.New("invalid parameters for list") // ErrNotFound defines the error if a member could not be found. ErrNotFound = errors.New("user or pack not found") // ErrAlreadyAssigned defines the error if a member is already assigned. ErrAlreadyAssigned = errors.New("user pack already exists") // ErrNotAssigned defines the error if a member is not assigned. ErrNotAssigned = errors.New("user pack is not defined") )
Functions ¶
This section is empty.
Types ¶
type GormService ¶
type GormService struct {
// contains filtered or unexported fields
}
GormService defines the service to store content within a database based on Gorm.
func NewGormService ¶
func NewGormService( handle *gorm.DB, cfg *config.Config, users usersService.Service, packs packsService.Service, ) *GormService
NewGormService initializes the service to store content within a database based on Gorm.
func (*GormService) Attach ¶
func (s *GormService) Attach(ctx context.Context, params model.UserPackParams) error
Attach implements the Service interface for database persistence.
func (*GormService) Drop ¶
func (s *GormService) Drop(ctx context.Context, params model.UserPackParams) error
Drop implements the Service interface for database persistence.
func (*GormService) List ¶
func (s *GormService) List(ctx context.Context, params model.UserPackParams) ([]*model.UserPack, int64, error)
List implements the Service interface for database persistence.
func (*GormService) Permit ¶
func (s *GormService) Permit(ctx context.Context, params model.UserPackParams) error
Permit implements the Service interface for database persistence.
func (*GormService) WithPrincipal ¶
func (s *GormService) WithPrincipal(principal *model.User) Service
WithPrincipal implements the Service interface for database persistence.
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) Attach ¶
func (m *MockService) Attach(arg0 context.Context, arg1 model.UserPackParams) error
Attach mocks base method.
func (*MockService) Drop ¶
func (m *MockService) Drop(arg0 context.Context, arg1 model.UserPackParams) error
Drop 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) List ¶
func (m *MockService) List(arg0 context.Context, arg1 model.UserPackParams) ([]*model.UserPack, int64, error)
List mocks base method.
func (*MockService) Permit ¶
func (m *MockService) Permit(arg0 context.Context, arg1 model.UserPackParams) error
Permit mocks base method.
func (*MockService) WithPrincipal ¶
func (m *MockService) WithPrincipal(arg0 *model.User) Service
WithPrincipal mocks base method.
type MockServiceMockRecorder ¶
type MockServiceMockRecorder struct {
// contains filtered or unexported fields
}
MockServiceMockRecorder is the mock recorder for MockService.
func (*MockServiceMockRecorder) Attach ¶
func (mr *MockServiceMockRecorder) Attach(arg0, arg1 interface{}) *gomock.Call
Attach indicates an expected call of Attach.
func (*MockServiceMockRecorder) Drop ¶
func (mr *MockServiceMockRecorder) Drop(arg0, arg1 interface{}) *gomock.Call
Drop indicates an expected call of Drop.
func (*MockServiceMockRecorder) List ¶
func (mr *MockServiceMockRecorder) List(arg0, arg1 interface{}) *gomock.Call
List indicates an expected call of List.
func (*MockServiceMockRecorder) Permit ¶
func (mr *MockServiceMockRecorder) Permit(arg0, arg1 interface{}) *gomock.Call
Permit indicates an expected call of Permit.
func (*MockServiceMockRecorder) WithPrincipal ¶
func (mr *MockServiceMockRecorder) WithPrincipal(arg0 interface{}) *gomock.Call
WithPrincipal indicates an expected call of WithPrincipal.
type Service ¶
type Service interface { List(context.Context, model.UserPackParams) ([]*model.UserPack, int64, error) Attach(context.Context, model.UserPackParams) error Permit(context.Context, model.UserPackParams) error Drop(context.Context, model.UserPackParams) error WithPrincipal(*model.User) Service }
Service handles all interactions with userpacks.
func NewLoggingService ¶
NewLoggingService wraps the Service and provides logging for its methods.
func NewMetricsService ¶
NewMetricsService wraps the Service and provides metrics for its methods.
func NewService ¶
NewService returns a Service that handles all interactions with userpacks.