preference

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2022 License: MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package preference is a generated GoMock package.

Package preference is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultRepo

type DefaultRepo struct {
	gorm.Model
	UserID uint

	Name          string
	Visibility    string
	DefaultBranch string
}

DefaultRepo represents an entity model used to store & retrieve user's default repo to/from database.

type MockRepo

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

MockRepo is a mock of Repo interface.

func NewMockRepo

func NewMockRepo(ctrl *gomock.Controller) *MockRepo

NewMockRepo creates a new mock instance.

func (*MockRepo) EXPECT

func (m *MockRepo) EXPECT() *MockRepoMockRecorder

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

func (*MockRepo) GetByUserID

func (m *MockRepo) GetByUserID(userID uint) (DefaultRepo, error)

GetByUserID mocks base method.

func (*MockRepo) Save

func (m *MockRepo) Save(defaultRepo DefaultRepo) error

Save mocks base method.

type MockRepoMockRecorder

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

MockRepoMockRecorder is the mock recorder for MockRepo.

func (*MockRepoMockRecorder) GetByUserID

func (mr *MockRepoMockRecorder) GetByUserID(userID interface{}) *gomock.Call

GetByUserID indicates an expected call of GetByUserID.

func (*MockRepoMockRecorder) Save

func (mr *MockRepoMockRecorder) Save(defaultRepo interface{}) *gomock.Call

Save indicates an expected call of Save.

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

func (m *MockService) EXPECT() *MockServiceMockRecorder

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

func (*MockService) GetByUserID

func (m *MockService) GetByUserID(userID uint) (DefaultRepo, error)

GetByUserID mocks base method.

func (*MockService) Save

func (m *MockService) Save(defaultRepo DefaultRepo) error

Save mocks base method.

type MockServiceMockRecorder

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

MockServiceMockRecorder is the mock recorder for MockService.

func (*MockServiceMockRecorder) GetByUserID

func (mr *MockServiceMockRecorder) GetByUserID(userID interface{}) *gomock.Call

GetByUserID indicates an expected call of GetByUserID.

func (*MockServiceMockRecorder) Save

func (mr *MockServiceMockRecorder) Save(defaultRepo interface{}) *gomock.Call

Save indicates an expected call of Save.

type Repo

type Repo interface {
	Save(defaultRepo DefaultRepo) error
	GetByUserID(userID uint) (DefaultRepo, error)
}

Repo represents a preference repository. It provides methods retrieve and save the user preferences from database.

func NewRepository

func NewRepository(db *gorm.DB) Repo

NewRepository creates and returns a new instance of preference repository.

type Service

type Service interface {
	Save(defaultRepo DefaultRepo) error
	GetByUserID(userID uint) (DefaultRepo, error)
}

Service represents a preference service. It provides methods to manager user preferences.

func NewService

func NewService(repo Repo) Service

NewService creates and return a new preference service.

Jump to

Keyboard shortcuts

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