Documentation ¶
Overview ¶
Package userteams is a generated GoMock package.
Index ¶
- Variables
- type GormService
- func (s *GormService) Attach(ctx context.Context, params model.UserTeamParams) error
- func (s *GormService) Drop(ctx context.Context, params model.UserTeamParams) error
- func (s *GormService) List(ctx context.Context, params model.UserTeamParams) ([]*model.UserTeam, int64, error)
- func (s *GormService) Permit(ctx context.Context, params model.UserTeamParams) error
- func (s *GormService) WithPrincipal(principal *model.User) Service
- type MockService
- func (m *MockService) Attach(arg0 context.Context, arg1 model.UserTeamParams) error
- func (m *MockService) Drop(arg0 context.Context, arg1 model.UserTeamParams) error
- func (m *MockService) EXPECT() *MockServiceMockRecorder
- func (m *MockService) List(arg0 context.Context, arg1 model.UserTeamParams) ([]*model.UserTeam, int64, error)
- func (m *MockService) Permit(arg0 context.Context, arg1 model.UserTeamParams) 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 user team could not be found. ErrNotFound = errors.New("team or user not found") // ErrAlreadyAssigned defines the error if a user team is already assigned. ErrAlreadyAssigned = errors.New("is already attached") // ErrNotAssigned defines the error if a user team is not assigned. ErrNotAssigned = errors.New("is not attached") )
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, teams teamsService.Service, users usersService.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.UserTeamParams) error
Attach implements the Service interface for database persistence.
func (*GormService) Drop ¶
func (s *GormService) Drop(ctx context.Context, params model.UserTeamParams) error
Drop implements the Service interface for database persistence.
func (*GormService) List ¶
func (s *GormService) List(ctx context.Context, params model.UserTeamParams) ([]*model.UserTeam, int64, error)
List implements the Service interface for database persistence.
func (*GormService) Permit ¶
func (s *GormService) Permit(ctx context.Context, params model.UserTeamParams) 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.UserTeamParams) error
Attach mocks base method.
func (*MockService) Drop ¶
func (m *MockService) Drop(arg0 context.Context, arg1 model.UserTeamParams) 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.UserTeamParams) ([]*model.UserTeam, int64, error)
List mocks base method.
func (*MockService) Permit ¶
func (m *MockService) Permit(arg0 context.Context, arg1 model.UserTeamParams) 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.UserTeamParams) ([]*model.UserTeam, int64, error) Attach(context.Context, model.UserTeamParams) error Permit(context.Context, model.UserTeamParams) error Drop(context.Context, model.UserTeamParams) error WithPrincipal(*model.User) Service }
Service handles all interactions with user team.
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 user teams.