Documentation ¶
Overview ¶
Package repository is a generated GoMock package.
Index ¶
- Variables
- type GormRepository
- func (r *GormRepository) Create(ctx context.Context, team *model.Team) (*model.Team, error)
- func (r *GormRepository) Delete(ctx context.Context, name string) error
- func (r *GormRepository) Exists(ctx context.Context, name string) (bool, error)
- func (r *GormRepository) List(ctx context.Context) ([]*model.Team, error)
- func (r *GormRepository) Show(ctx context.Context, name string) (*model.Team, error)
- func (r *GormRepository) Update(ctx context.Context, team *model.Team) (*model.Team, error)
- type LoggingRepository
- func (r *LoggingRepository) Create(ctx context.Context, team *model.Team) (*model.Team, error)
- func (r *LoggingRepository) Delete(ctx context.Context, name string) error
- func (r *LoggingRepository) Exists(ctx context.Context, name string) (bool, error)
- func (r *LoggingRepository) List(ctx context.Context) ([]*model.Team, error)
- func (r *LoggingRepository) Show(ctx context.Context, name string) (*model.Team, error)
- func (r *LoggingRepository) Update(ctx context.Context, team *model.Team) (*model.Team, error)
- type LoggingRequestID
- type MetricsTeamsRepository
- func (r *MetricsTeamsRepository) Create(ctx context.Context, team *model.Team) (*model.Team, error)
- func (r *MetricsTeamsRepository) Delete(ctx context.Context, name string) error
- func (r *MetricsTeamsRepository) Exists(ctx context.Context, name string) (bool, error)
- func (r *MetricsTeamsRepository) List(ctx context.Context) ([]*model.Team, error)
- func (r *MetricsTeamsRepository) Show(ctx context.Context, id string) (*model.Team, error)
- func (r *MetricsTeamsRepository) Update(ctx context.Context, team *model.Team) (*model.Team, error)
- type MockTeamsRepository
- func (m *MockTeamsRepository) Create(arg0 context.Context, arg1 *model.Team) (*model.Team, error)
- func (m *MockTeamsRepository) Delete(arg0 context.Context, arg1 string) error
- func (m *MockTeamsRepository) EXPECT() *MockTeamsRepositoryMockRecorder
- func (m *MockTeamsRepository) Exists(arg0 context.Context, arg1 string) (bool, error)
- func (m *MockTeamsRepository) List(arg0 context.Context) ([]*model.Team, error)
- func (m *MockTeamsRepository) Show(arg0 context.Context, arg1 string) (*model.Team, error)
- func (m *MockTeamsRepository) Update(arg0 context.Context, arg1 *model.Team) (*model.Team, error)
- type MockTeamsRepositoryMockRecorder
- func (mr *MockTeamsRepositoryMockRecorder) Create(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockTeamsRepositoryMockRecorder) Delete(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockTeamsRepositoryMockRecorder) Exists(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockTeamsRepositoryMockRecorder) List(arg0 interface{}) *gomock.Call
- func (mr *MockTeamsRepositoryMockRecorder) Show(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockTeamsRepositoryMockRecorder) Update(arg0, arg1 interface{}) *gomock.Call
- type TeamsRepository
Constants ¶
This section is empty.
Variables ¶
var ( // ErrTeamNotFound defines the error if a team could not be found. ErrTeamNotFound = errors.New("user not found") // ErrTeamOrUserNotFound defines the error if a team or user could not be found. ErrTeamOrUserNotFound = errors.New("team or user not found") // ErrUserNotAssigned defines the error if a team is not assigned to a user. ErrUserNotAssigned = errors.New("team is not assigned") // ErrUserAlreadyAssigned defines the error if a team is already assigned to a user. ErrUserAlreadyAssigned = errors.New("team is already assigned") )
Functions ¶
This section is empty.
Types ¶
type GormRepository ¶
type GormRepository struct {
// contains filtered or unexported fields
}
GormRepository implements the TeamsRepository interface.
func NewGormRepository ¶
func NewGormRepository( handle *gorm.DB, ) *GormRepository
NewGormRepository initializes a new repository for GormDB.
func (*GormRepository) Delete ¶
func (r *GormRepository) Delete(ctx context.Context, name string) error
Delete implements the TeamsRepository interface.
type LoggingRepository ¶
type LoggingRepository struct {
// contains filtered or unexported fields
}
LoggingRepository implements TeamsRepository interface.
func (*LoggingRepository) Delete ¶
func (r *LoggingRepository) Delete(ctx context.Context, name string) error
Delete implements the TeamsRepository interface.
type LoggingRequestID ¶
LoggingRequestID returns the request ID as string for logging
type MetricsTeamsRepository ¶
type MetricsTeamsRepository struct {
// contains filtered or unexported fields
}
MetricsTeamsRepository implements TeamsRepository interface.
func (*MetricsTeamsRepository) Delete ¶
func (r *MetricsTeamsRepository) Delete(ctx context.Context, name string) error
Delete implements the TeamsRepository interface.
type MockTeamsRepository ¶
type MockTeamsRepository struct {
// contains filtered or unexported fields
}
MockTeamsRepository is a mock of TeamsRepository interface.
func NewMockTeamsRepository ¶
func NewMockTeamsRepository(ctrl *gomock.Controller) *MockTeamsRepository
NewMockTeamsRepository creates a new mock instance.
func (*MockTeamsRepository) Delete ¶
func (m *MockTeamsRepository) Delete(arg0 context.Context, arg1 string) error
Delete mocks base method.
func (*MockTeamsRepository) EXPECT ¶
func (m *MockTeamsRepository) EXPECT() *MockTeamsRepositoryMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockTeamsRepositoryMockRecorder ¶
type MockTeamsRepositoryMockRecorder struct {
// contains filtered or unexported fields
}
MockTeamsRepositoryMockRecorder is the mock recorder for MockTeamsRepository.
func (*MockTeamsRepositoryMockRecorder) Create ¶
func (mr *MockTeamsRepositoryMockRecorder) Create(arg0, arg1 interface{}) *gomock.Call
Create indicates an expected call of Create.
func (*MockTeamsRepositoryMockRecorder) Delete ¶
func (mr *MockTeamsRepositoryMockRecorder) Delete(arg0, arg1 interface{}) *gomock.Call
Delete indicates an expected call of Delete.
func (*MockTeamsRepositoryMockRecorder) Exists ¶
func (mr *MockTeamsRepositoryMockRecorder) Exists(arg0, arg1 interface{}) *gomock.Call
Exists indicates an expected call of Exists.
func (*MockTeamsRepositoryMockRecorder) List ¶
func (mr *MockTeamsRepositoryMockRecorder) List(arg0 interface{}) *gomock.Call
List indicates an expected call of List.
func (*MockTeamsRepositoryMockRecorder) Show ¶
func (mr *MockTeamsRepositoryMockRecorder) Show(arg0, arg1 interface{}) *gomock.Call
Show indicates an expected call of Show.
func (*MockTeamsRepositoryMockRecorder) Update ¶
func (mr *MockTeamsRepositoryMockRecorder) Update(arg0, arg1 interface{}) *gomock.Call
Update indicates an expected call of Update.
type TeamsRepository ¶
type TeamsRepository interface { List(context.Context) ([]*model.Team, error) Create(context.Context, *model.Team) (*model.Team, error) Update(context.Context, *model.Team) (*model.Team, error) Show(context.Context, string) (*model.Team, error) Delete(context.Context, string) error Exists(context.Context, string) (bool, error) }
TeamsRepository defines the required functions for the repository.
func NewLoggingRepository ¶
func NewLoggingRepository(repository TeamsRepository, requestID LoggingRequestID) TeamsRepository
NewLoggingRepository wraps the TeamsRepository and provides logging for its methods.
func NewMetricsRepository ¶
func NewMetricsRepository(repository TeamsRepository, metricz *metrics.Metrics) TeamsRepository
NewMetricsRepository wraps the TeamsRepository and provides metrics for its methods.