repository

package
v0.0.0-...-86bd853 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package repository is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
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) Create

func (r *GormRepository) Create(ctx context.Context, team *model.Team) (*model.Team, error)

Create implements the TeamsRepository interface.

func (*GormRepository) Delete

func (r *GormRepository) Delete(ctx context.Context, name string) error

Delete implements the TeamsRepository interface.

func (*GormRepository) Exists

func (r *GormRepository) Exists(ctx context.Context, name string) (bool, error)

Exists implements the TeamsRepository interface.

func (*GormRepository) List

func (r *GormRepository) List(ctx context.Context) ([]*model.Team, error)

List implements the TeamsRepository interface.

func (*GormRepository) Show

func (r *GormRepository) Show(ctx context.Context, name string) (*model.Team, error)

Show implements the TeamsRepository interface.

func (*GormRepository) Update

func (r *GormRepository) Update(ctx context.Context, team *model.Team) (*model.Team, error)

Update implements the TeamsRepository interface.

type LoggingRepository

type LoggingRepository struct {
	// contains filtered or unexported fields
}

LoggingRepository implements TeamsRepository interface.

func (*LoggingRepository) Create

func (r *LoggingRepository) Create(ctx context.Context, team *model.Team) (*model.Team, error)

Create implements the TeamsRepository interface.

func (*LoggingRepository) Delete

func (r *LoggingRepository) Delete(ctx context.Context, name string) error

Delete implements the TeamsRepository interface.

func (*LoggingRepository) Exists

func (r *LoggingRepository) Exists(ctx context.Context, name string) (bool, error)

Exists implements the TeamsRepository interface.

func (*LoggingRepository) List

func (r *LoggingRepository) List(ctx context.Context) ([]*model.Team, error)

List implements the TeamsRepository interface.

func (*LoggingRepository) Show

func (r *LoggingRepository) Show(ctx context.Context, name string) (*model.Team, error)

Show implements the TeamsRepository interface.

func (*LoggingRepository) Update

func (r *LoggingRepository) Update(ctx context.Context, team *model.Team) (*model.Team, error)

Update implements the TeamsRepository interface.

type LoggingRequestID

type LoggingRequestID func(context.Context) string

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) Create

func (r *MetricsTeamsRepository) Create(ctx context.Context, team *model.Team) (*model.Team, error)

Create implements the TeamsRepository interface.

func (*MetricsTeamsRepository) Delete

func (r *MetricsTeamsRepository) Delete(ctx context.Context, name string) error

Delete implements the TeamsRepository interface.

func (*MetricsTeamsRepository) Exists

func (r *MetricsTeamsRepository) Exists(ctx context.Context, name string) (bool, error)

Exists implements the TeamsRepository interface.

func (*MetricsTeamsRepository) List

List implements the TeamsRepository interface.

func (*MetricsTeamsRepository) Show

Show implements the TeamsRepository interface.

func (*MetricsTeamsRepository) Update

func (r *MetricsTeamsRepository) Update(ctx context.Context, team *model.Team) (*model.Team, error)

Update 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) Create

func (m *MockTeamsRepository) Create(arg0 context.Context, arg1 *model.Team) (*model.Team, error)

Create mocks base method.

func (*MockTeamsRepository) Delete

func (m *MockTeamsRepository) Delete(arg0 context.Context, arg1 string) error

Delete mocks base method.

func (*MockTeamsRepository) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockTeamsRepository) Exists

func (m *MockTeamsRepository) Exists(arg0 context.Context, arg1 string) (bool, error)

Exists mocks base method.

func (*MockTeamsRepository) List

func (m *MockTeamsRepository) List(arg0 context.Context) ([]*model.Team, error)

List mocks base method.

func (*MockTeamsRepository) Show

func (m *MockTeamsRepository) Show(arg0 context.Context, arg1 string) (*model.Team, error)

Show mocks base method.

func (*MockTeamsRepository) Update

func (m *MockTeamsRepository) Update(arg0 context.Context, arg1 *model.Team) (*model.Team, error)

Update mocks base method.

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.

Jump to

Keyboard shortcuts

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