userteams

package
v0.0.0-...-2bf976c Latest Latest
Warning

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

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

Documentation

Overview

Package userteams is a generated GoMock package.

Index

Constants

This section is empty.

Variables

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

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

Service handles all interactions with user team.

func NewLoggingService

func NewLoggingService(s Service) Service

NewLoggingService wraps the Service and provides logging for its methods.

func NewMetricsService

func NewMetricsService(s Service, m *metrics.Metrics) Service

NewMetricsService wraps the Service and provides metrics for its methods.

func NewService

func NewService(userteams Service) Service

NewService returns a Service that handles all interactions with user teams.

Jump to

Keyboard shortcuts

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