Documentation ¶
Overview ¶
Package user is a generated GoMock package.
Package user is a generated GoMock package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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) GetByEmail ¶
GetByEmail mocks base method.
type MockRepoMockRecorder ¶
type MockRepoMockRecorder struct {
// contains filtered or unexported fields
}
MockRepoMockRecorder is the mock recorder for MockRepo.
func (*MockRepoMockRecorder) Delete ¶
func (mr *MockRepoMockRecorder) Delete(userID interface{}) *gomock.Call
Delete indicates an expected call of Delete.
func (*MockRepoMockRecorder) Get ¶
func (mr *MockRepoMockRecorder) Get(userID interface{}) *gomock.Call
Get indicates an expected call of Get.
func (*MockRepoMockRecorder) GetByEmail ¶
func (mr *MockRepoMockRecorder) GetByEmail(email interface{}) *gomock.Call
GetByEmail indicates an expected call of GetByEmail.
func (*MockRepoMockRecorder) Save ¶
func (mr *MockRepoMockRecorder) Save(user 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) Delete ¶
func (m *MockService) Delete(userID uint) error
Delete 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) Get ¶
func (m *MockService) Get(userID uint) (User, error)
Get mocks base method.
func (*MockService) GetByEmail ¶
func (m *MockService) GetByEmail(email string) (User, error)
GetByEmail mocks base method.
type MockServiceMockRecorder ¶
type MockServiceMockRecorder struct {
// contains filtered or unexported fields
}
MockServiceMockRecorder is the mock recorder for MockService.
func (*MockServiceMockRecorder) Delete ¶
func (mr *MockServiceMockRecorder) Delete(userID interface{}) *gomock.Call
Delete indicates an expected call of Delete.
func (*MockServiceMockRecorder) Get ¶
func (mr *MockServiceMockRecorder) Get(userID interface{}) *gomock.Call
Get indicates an expected call of Get.
func (*MockServiceMockRecorder) GetByEmail ¶
func (mr *MockServiceMockRecorder) GetByEmail(email interface{}) *gomock.Call
GetByEmail indicates an expected call of GetByEmail.
func (*MockServiceMockRecorder) Save ¶
func (mr *MockServiceMockRecorder) Save(user interface{}) *gomock.Call
Save indicates an expected call of Save.
type Repo ¶
type Repo interface { Get(userID uint) (User, error) GetByEmail(email string) (User, error) Save(user User) (uint, error) Delete(userID uint) error }
Repo represents a user repository. It provides methods to retrieve and manage user records from the database.
func NewRepository ¶
NewRepository creates and returns a new instance of user repository.
type Service ¶
type Service interface { Get(userID uint) (User, error) GetByEmail(email string) (User, error) Save(user User) (uint, error) Delete(userID uint) error }
Service represents a user service. It provides different methods to manage app user.
func NewService ¶
NewService creates and return a new user service.
type User ¶
type User struct { gorm.Model Email string Name string Location string AvatarURL string GithubID int64 GithubUsername string GithubToken string DisabledAt *time.Time DefaultRepo *preference.DefaultRepo `gorm:"foreignkey:UserID"` }
User represent an entity model used for storing and retrieving user to/from database.