Documentation ¶
Index ¶
- Variables
- func NewError(err error, code Kind, message string) error
- type Error
- type Kind
- type MockPersonalAccessTokenMapper
- func (_m *MockPersonalAccessTokenMapper) Create(ctx context.Context, model *models.PersonalAccessToken) (*models.PersonalAccessToken, error)
- func (_m *MockPersonalAccessTokenMapper) EXPECT() *MockPersonalAccessTokenMapper_Expecter
- func (_m *MockPersonalAccessTokenMapper) Find(ctx context.Context, filter interface{}) (models.PersonalAccessTokens, error)
- func (_m *MockPersonalAccessTokenMapper) FindOne(ctx context.Context, filter interface{}) (*models.PersonalAccessToken, error)
- func (_m *MockPersonalAccessTokenMapper) Update(ctx context.Context, model *models.PersonalAccessToken) (*models.PersonalAccessToken, error)
- type MockPersonalAccessTokenMapper_Create_Call
- func (_c *MockPersonalAccessTokenMapper_Create_Call) Return(_a0 *models.PersonalAccessToken, _a1 error) *MockPersonalAccessTokenMapper_Create_Call
- func (_c *MockPersonalAccessTokenMapper_Create_Call) Run(run func(ctx context.Context, model *models.PersonalAccessToken)) *MockPersonalAccessTokenMapper_Create_Call
- func (_c *MockPersonalAccessTokenMapper_Create_Call) RunAndReturn(...) *MockPersonalAccessTokenMapper_Create_Call
- type MockPersonalAccessTokenMapper_Expecter
- func (_e *MockPersonalAccessTokenMapper_Expecter) Create(ctx interface{}, model interface{}) *MockPersonalAccessTokenMapper_Create_Call
- func (_e *MockPersonalAccessTokenMapper_Expecter) Find(ctx interface{}, filter interface{}) *MockPersonalAccessTokenMapper_Find_Call
- func (_e *MockPersonalAccessTokenMapper_Expecter) FindOne(ctx interface{}, filter interface{}) *MockPersonalAccessTokenMapper_FindOne_Call
- func (_e *MockPersonalAccessTokenMapper_Expecter) Update(ctx interface{}, model interface{}) *MockPersonalAccessTokenMapper_Update_Call
- type MockPersonalAccessTokenMapper_FindOne_Call
- func (_c *MockPersonalAccessTokenMapper_FindOne_Call) Return(_a0 *models.PersonalAccessToken, _a1 error) *MockPersonalAccessTokenMapper_FindOne_Call
- func (_c *MockPersonalAccessTokenMapper_FindOne_Call) Run(run func(ctx context.Context, filter interface{})) *MockPersonalAccessTokenMapper_FindOne_Call
- func (_c *MockPersonalAccessTokenMapper_FindOne_Call) RunAndReturn(run func(context.Context, interface{}) (*models.PersonalAccessToken, error)) *MockPersonalAccessTokenMapper_FindOne_Call
- type MockPersonalAccessTokenMapper_Find_Call
- func (_c *MockPersonalAccessTokenMapper_Find_Call) Return(_a0 models.PersonalAccessTokens, _a1 error) *MockPersonalAccessTokenMapper_Find_Call
- func (_c *MockPersonalAccessTokenMapper_Find_Call) Run(run func(ctx context.Context, filter interface{})) *MockPersonalAccessTokenMapper_Find_Call
- func (_c *MockPersonalAccessTokenMapper_Find_Call) RunAndReturn(run func(context.Context, interface{}) (models.PersonalAccessTokens, error)) *MockPersonalAccessTokenMapper_Find_Call
- type MockPersonalAccessTokenMapper_Update_Call
- func (_c *MockPersonalAccessTokenMapper_Update_Call) Return(_a0 *models.PersonalAccessToken, _a1 error) *MockPersonalAccessTokenMapper_Update_Call
- func (_c *MockPersonalAccessTokenMapper_Update_Call) Run(run func(ctx context.Context, model *models.PersonalAccessToken)) *MockPersonalAccessTokenMapper_Update_Call
- func (_c *MockPersonalAccessTokenMapper_Update_Call) RunAndReturn(...) *MockPersonalAccessTokenMapper_Update_Call
- type MockTaskMapper
- func (_m *MockTaskMapper) Create(ctx context.Context, model *models.Task) (*models.Task, error)
- func (_m *MockTaskMapper) EXPECT() *MockTaskMapper_Expecter
- func (_m *MockTaskMapper) Find(ctx context.Context, filter interface{}, limit int, skip int) (int64, models.Tasks, error)
- func (_m *MockTaskMapper) FindOneById(ctx context.Context, id string) (*models.Task, error)
- func (_m *MockTaskMapper) Update(ctx context.Context, model *models.Task) (*models.Task, error)
- type MockTaskMapper_Create_Call
- func (_c *MockTaskMapper_Create_Call) Return(_a0 *models.Task, _a1 error) *MockTaskMapper_Create_Call
- func (_c *MockTaskMapper_Create_Call) Run(run func(ctx context.Context, model *models.Task)) *MockTaskMapper_Create_Call
- func (_c *MockTaskMapper_Create_Call) RunAndReturn(run func(context.Context, *models.Task) (*models.Task, error)) *MockTaskMapper_Create_Call
- type MockTaskMapper_Expecter
- func (_e *MockTaskMapper_Expecter) Create(ctx interface{}, model interface{}) *MockTaskMapper_Create_Call
- func (_e *MockTaskMapper_Expecter) Find(ctx interface{}, filter interface{}, limit interface{}, skip interface{}) *MockTaskMapper_Find_Call
- func (_e *MockTaskMapper_Expecter) FindOneById(ctx interface{}, id interface{}) *MockTaskMapper_FindOneById_Call
- func (_e *MockTaskMapper_Expecter) Update(ctx interface{}, model interface{}) *MockTaskMapper_Update_Call
- type MockTaskMapper_FindOneById_Call
- func (_c *MockTaskMapper_FindOneById_Call) Return(_a0 *models.Task, _a1 error) *MockTaskMapper_FindOneById_Call
- func (_c *MockTaskMapper_FindOneById_Call) Run(run func(ctx context.Context, id string)) *MockTaskMapper_FindOneById_Call
- func (_c *MockTaskMapper_FindOneById_Call) RunAndReturn(run func(context.Context, string) (*models.Task, error)) *MockTaskMapper_FindOneById_Call
- type MockTaskMapper_Find_Call
- func (_c *MockTaskMapper_Find_Call) Return(_a0 int64, _a1 models.Tasks, _a2 error) *MockTaskMapper_Find_Call
- func (_c *MockTaskMapper_Find_Call) Run(run func(ctx context.Context, filter interface{}, limit int, skip int)) *MockTaskMapper_Find_Call
- func (_c *MockTaskMapper_Find_Call) RunAndReturn(run func(context.Context, interface{}, int, int) (int64, models.Tasks, error)) *MockTaskMapper_Find_Call
- type MockTaskMapper_Update_Call
- func (_c *MockTaskMapper_Update_Call) Return(_a0 *models.Task, _a1 error) *MockTaskMapper_Update_Call
- func (_c *MockTaskMapper_Update_Call) Run(run func(ctx context.Context, model *models.Task)) *MockTaskMapper_Update_Call
- func (_c *MockTaskMapper_Update_Call) RunAndReturn(run func(context.Context, *models.Task) (*models.Task, error)) *MockTaskMapper_Update_Call
- type MockUserMapper
- func (_m *MockUserMapper) Create(ctx context.Context, model *models.User) (*models.User, error)
- func (_m *MockUserMapper) EXPECT() *MockUserMapper_Expecter
- func (_m *MockUserMapper) Find(ctx context.Context, filter interface{}, limit int, skip int) (int64, models.Users, error)
- func (_m *MockUserMapper) FindOne(ctx context.Context, filter interface{}) (*models.User, error)
- func (_m *MockUserMapper) Update(ctx context.Context, model *models.User) (*models.User, error)
- type MockUserMapper_Create_Call
- func (_c *MockUserMapper_Create_Call) Return(_a0 *models.User, _a1 error) *MockUserMapper_Create_Call
- func (_c *MockUserMapper_Create_Call) Run(run func(ctx context.Context, model *models.User)) *MockUserMapper_Create_Call
- func (_c *MockUserMapper_Create_Call) RunAndReturn(run func(context.Context, *models.User) (*models.User, error)) *MockUserMapper_Create_Call
- type MockUserMapper_Expecter
- func (_e *MockUserMapper_Expecter) Create(ctx interface{}, model interface{}) *MockUserMapper_Create_Call
- func (_e *MockUserMapper_Expecter) Find(ctx interface{}, filter interface{}, limit interface{}, skip interface{}) *MockUserMapper_Find_Call
- func (_e *MockUserMapper_Expecter) FindOne(ctx interface{}, filter interface{}) *MockUserMapper_FindOne_Call
- func (_e *MockUserMapper_Expecter) Update(ctx interface{}, model interface{}) *MockUserMapper_Update_Call
- type MockUserMapper_FindOne_Call
- func (_c *MockUserMapper_FindOne_Call) Return(_a0 *models.User, _a1 error) *MockUserMapper_FindOne_Call
- func (_c *MockUserMapper_FindOne_Call) Run(run func(ctx context.Context, filter interface{})) *MockUserMapper_FindOne_Call
- func (_c *MockUserMapper_FindOne_Call) RunAndReturn(run func(context.Context, interface{}) (*models.User, error)) *MockUserMapper_FindOne_Call
- type MockUserMapper_Find_Call
- func (_c *MockUserMapper_Find_Call) Return(_a0 int64, _a1 models.Users, _a2 error) *MockUserMapper_Find_Call
- func (_c *MockUserMapper_Find_Call) Run(run func(ctx context.Context, filter interface{}, limit int, skip int)) *MockUserMapper_Find_Call
- func (_c *MockUserMapper_Find_Call) RunAndReturn(run func(context.Context, interface{}, int, int) (int64, models.Users, error)) *MockUserMapper_Find_Call
- type MockUserMapper_Update_Call
- func (_c *MockUserMapper_Update_Call) Return(_a0 *models.User, _a1 error) *MockUserMapper_Update_Call
- func (_c *MockUserMapper_Update_Call) Run(run func(ctx context.Context, model *models.User)) *MockUserMapper_Update_Call
- func (_c *MockUserMapper_Update_Call) RunAndReturn(run func(context.Context, *models.User) (*models.User, error)) *MockUserMapper_Update_Call
- type PersonalAccessToken
- func (t *PersonalAccessToken) Create(ctx context.Context, model *models.PersonalAccessToken) (*models.PersonalAccessToken, error)
- func (t *PersonalAccessToken) Find(ctx context.Context, userId string) (models.PersonalAccessTokens, error)
- func (t *PersonalAccessToken) FindOne(ctx context.Context, userId string, name string) (*models.PersonalAccessToken, error)
- func (t *PersonalAccessToken) Read(ctx context.Context, userId string, id string) (*models.PersonalAccessToken, error)
- func (t *PersonalAccessToken) Revoke(ctx context.Context, model *models.PersonalAccessToken) error
- type PersonalAccessTokenMapper
- type Task
- func (t *Task) Create(ctx context.Context, id string, model *models.Task) (*models.Task, error)
- func (t *Task) Delete(ctx context.Context, id string, model *models.Task) error
- func (t *Task) Find(ctx context.Context, params *models.TaskSearchParams) (int64, models.Tasks, error)
- func (t *Task) Read(ctx context.Context, id string) (*models.Task, error)
- func (t *Task) Update(ctx context.Context, id string, model *models.Task) (*models.Task, error)
- type TaskMapper
- type User
- func (u *User) Create(ctx context.Context, model *models.User) (*models.User, error)
- func (u *User) Delete(ctx context.Context, id string, model *models.User) error
- func (u *User) Find(ctx context.Context, params *models.UserSearchParams) (int64, models.Users, error)
- func (u *User) FindOneByEmailOrUsername(ctx context.Context, email string, username string) (*models.User, error)
- func (u *User) Read(ctx context.Context, id string) (*models.User, error)
- func (u *User) Update(ctx context.Context, id string, model *models.User) (*models.User, error)
- type UserMapper
Constants ¶
This section is empty.
Variables ¶
var ( ErrTaskDeleted = errors.New("task was deleted") ErrTaskNotFound = errors.New("task not found") )
var ( ErrUserDeleted = errors.New("user was deleted") ErrUserExist = errors.New("email or username already in-use") ErrUserNotFound = errors.New("user not found") )
var ErrPersonalAccessTokenNotFound = errors.New("personal access token not found")
Functions ¶
Types ¶
type Error ¶
Error represents an error that could be wrapping another error.
type MockPersonalAccessTokenMapper ¶
MockPersonalAccessTokenMapper is an autogenerated mock type for the PersonalAccessTokenMapper type
func NewMockPersonalAccessTokenMapper ¶
func NewMockPersonalAccessTokenMapper(t interface { mock.TestingT Cleanup(func()) }) *MockPersonalAccessTokenMapper
NewMockPersonalAccessTokenMapper creates a new instance of MockPersonalAccessTokenMapper. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockPersonalAccessTokenMapper) Create ¶
func (_m *MockPersonalAccessTokenMapper) Create(ctx context.Context, model *models.PersonalAccessToken) (*models.PersonalAccessToken, error)
Create provides a mock function with given fields: ctx, model
func (*MockPersonalAccessTokenMapper) EXPECT ¶
func (_m *MockPersonalAccessTokenMapper) EXPECT() *MockPersonalAccessTokenMapper_Expecter
func (*MockPersonalAccessTokenMapper) Find ¶
func (_m *MockPersonalAccessTokenMapper) Find(ctx context.Context, filter interface{}) (models.PersonalAccessTokens, error)
Find provides a mock function with given fields: ctx, filter
func (*MockPersonalAccessTokenMapper) FindOne ¶
func (_m *MockPersonalAccessTokenMapper) FindOne(ctx context.Context, filter interface{}) (*models.PersonalAccessToken, error)
FindOne provides a mock function with given fields: ctx, filter
func (*MockPersonalAccessTokenMapper) Update ¶
func (_m *MockPersonalAccessTokenMapper) Update(ctx context.Context, model *models.PersonalAccessToken) (*models.PersonalAccessToken, error)
Update provides a mock function with given fields: ctx, model
type MockPersonalAccessTokenMapper_Create_Call ¶
MockPersonalAccessTokenMapper_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create'
func (*MockPersonalAccessTokenMapper_Create_Call) Return ¶
func (_c *MockPersonalAccessTokenMapper_Create_Call) Return(_a0 *models.PersonalAccessToken, _a1 error) *MockPersonalAccessTokenMapper_Create_Call
func (*MockPersonalAccessTokenMapper_Create_Call) Run ¶
func (_c *MockPersonalAccessTokenMapper_Create_Call) Run(run func(ctx context.Context, model *models.PersonalAccessToken)) *MockPersonalAccessTokenMapper_Create_Call
func (*MockPersonalAccessTokenMapper_Create_Call) RunAndReturn ¶
func (_c *MockPersonalAccessTokenMapper_Create_Call) RunAndReturn(run func(context.Context, *models.PersonalAccessToken) (*models.PersonalAccessToken, error)) *MockPersonalAccessTokenMapper_Create_Call
type MockPersonalAccessTokenMapper_Expecter ¶
type MockPersonalAccessTokenMapper_Expecter struct {
// contains filtered or unexported fields
}
func (*MockPersonalAccessTokenMapper_Expecter) Create ¶
func (_e *MockPersonalAccessTokenMapper_Expecter) Create(ctx interface{}, model interface{}) *MockPersonalAccessTokenMapper_Create_Call
Create is a helper method to define mock.On call
- ctx context.Context
- model *models.PersonalAccessToken
func (*MockPersonalAccessTokenMapper_Expecter) Find ¶
func (_e *MockPersonalAccessTokenMapper_Expecter) Find(ctx interface{}, filter interface{}) *MockPersonalAccessTokenMapper_Find_Call
Find is a helper method to define mock.On call
- ctx context.Context
- filter interface{}
func (*MockPersonalAccessTokenMapper_Expecter) FindOne ¶
func (_e *MockPersonalAccessTokenMapper_Expecter) FindOne(ctx interface{}, filter interface{}) *MockPersonalAccessTokenMapper_FindOne_Call
FindOne is a helper method to define mock.On call
- ctx context.Context
- filter interface{}
func (*MockPersonalAccessTokenMapper_Expecter) Update ¶
func (_e *MockPersonalAccessTokenMapper_Expecter) Update(ctx interface{}, model interface{}) *MockPersonalAccessTokenMapper_Update_Call
Update is a helper method to define mock.On call
- ctx context.Context
- model *models.PersonalAccessToken
type MockPersonalAccessTokenMapper_FindOne_Call ¶
MockPersonalAccessTokenMapper_FindOne_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindOne'
func (*MockPersonalAccessTokenMapper_FindOne_Call) Return ¶
func (_c *MockPersonalAccessTokenMapper_FindOne_Call) Return(_a0 *models.PersonalAccessToken, _a1 error) *MockPersonalAccessTokenMapper_FindOne_Call
func (*MockPersonalAccessTokenMapper_FindOne_Call) Run ¶
func (_c *MockPersonalAccessTokenMapper_FindOne_Call) Run(run func(ctx context.Context, filter interface{})) *MockPersonalAccessTokenMapper_FindOne_Call
func (*MockPersonalAccessTokenMapper_FindOne_Call) RunAndReturn ¶
func (_c *MockPersonalAccessTokenMapper_FindOne_Call) RunAndReturn(run func(context.Context, interface{}) (*models.PersonalAccessToken, error)) *MockPersonalAccessTokenMapper_FindOne_Call
type MockPersonalAccessTokenMapper_Find_Call ¶
MockPersonalAccessTokenMapper_Find_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Find'
func (*MockPersonalAccessTokenMapper_Find_Call) Return ¶
func (_c *MockPersonalAccessTokenMapper_Find_Call) Return(_a0 models.PersonalAccessTokens, _a1 error) *MockPersonalAccessTokenMapper_Find_Call
func (*MockPersonalAccessTokenMapper_Find_Call) Run ¶
func (_c *MockPersonalAccessTokenMapper_Find_Call) Run(run func(ctx context.Context, filter interface{})) *MockPersonalAccessTokenMapper_Find_Call
func (*MockPersonalAccessTokenMapper_Find_Call) RunAndReturn ¶
func (_c *MockPersonalAccessTokenMapper_Find_Call) RunAndReturn(run func(context.Context, interface{}) (models.PersonalAccessTokens, error)) *MockPersonalAccessTokenMapper_Find_Call
type MockPersonalAccessTokenMapper_Update_Call ¶
MockPersonalAccessTokenMapper_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update'
func (*MockPersonalAccessTokenMapper_Update_Call) Return ¶
func (_c *MockPersonalAccessTokenMapper_Update_Call) Return(_a0 *models.PersonalAccessToken, _a1 error) *MockPersonalAccessTokenMapper_Update_Call
func (*MockPersonalAccessTokenMapper_Update_Call) Run ¶
func (_c *MockPersonalAccessTokenMapper_Update_Call) Run(run func(ctx context.Context, model *models.PersonalAccessToken)) *MockPersonalAccessTokenMapper_Update_Call
func (*MockPersonalAccessTokenMapper_Update_Call) RunAndReturn ¶
func (_c *MockPersonalAccessTokenMapper_Update_Call) RunAndReturn(run func(context.Context, *models.PersonalAccessToken) (*models.PersonalAccessToken, error)) *MockPersonalAccessTokenMapper_Update_Call
type MockTaskMapper ¶
MockTaskMapper is an autogenerated mock type for the TaskMapper type
func NewMockTaskMapper ¶
func NewMockTaskMapper(t interface { mock.TestingT Cleanup(func()) }) *MockTaskMapper
NewMockTaskMapper creates a new instance of MockTaskMapper. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockTaskMapper) EXPECT ¶
func (_m *MockTaskMapper) EXPECT() *MockTaskMapper_Expecter
func (*MockTaskMapper) Find ¶
func (_m *MockTaskMapper) Find(ctx context.Context, filter interface{}, limit int, skip int) (int64, models.Tasks, error)
Find provides a mock function with given fields: ctx, filter, limit, skip
func (*MockTaskMapper) FindOneById ¶
FindOneById provides a mock function with given fields: ctx, id
type MockTaskMapper_Create_Call ¶
MockTaskMapper_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create'
func (*MockTaskMapper_Create_Call) Return ¶
func (_c *MockTaskMapper_Create_Call) Return(_a0 *models.Task, _a1 error) *MockTaskMapper_Create_Call
func (*MockTaskMapper_Create_Call) Run ¶
func (_c *MockTaskMapper_Create_Call) Run(run func(ctx context.Context, model *models.Task)) *MockTaskMapper_Create_Call
func (*MockTaskMapper_Create_Call) RunAndReturn ¶
func (_c *MockTaskMapper_Create_Call) RunAndReturn(run func(context.Context, *models.Task) (*models.Task, error)) *MockTaskMapper_Create_Call
type MockTaskMapper_Expecter ¶
type MockTaskMapper_Expecter struct {
// contains filtered or unexported fields
}
func (*MockTaskMapper_Expecter) Create ¶
func (_e *MockTaskMapper_Expecter) Create(ctx interface{}, model interface{}) *MockTaskMapper_Create_Call
Create is a helper method to define mock.On call
- ctx context.Context
- model *models.Task
func (*MockTaskMapper_Expecter) Find ¶
func (_e *MockTaskMapper_Expecter) Find(ctx interface{}, filter interface{}, limit interface{}, skip interface{}) *MockTaskMapper_Find_Call
Find is a helper method to define mock.On call
- ctx context.Context
- filter interface{}
- limit int
- skip int
func (*MockTaskMapper_Expecter) FindOneById ¶
func (_e *MockTaskMapper_Expecter) FindOneById(ctx interface{}, id interface{}) *MockTaskMapper_FindOneById_Call
FindOneById is a helper method to define mock.On call
- ctx context.Context
- id string
func (*MockTaskMapper_Expecter) Update ¶
func (_e *MockTaskMapper_Expecter) Update(ctx interface{}, model interface{}) *MockTaskMapper_Update_Call
Update is a helper method to define mock.On call
- ctx context.Context
- model *models.Task
type MockTaskMapper_FindOneById_Call ¶
MockTaskMapper_FindOneById_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindOneById'
func (*MockTaskMapper_FindOneById_Call) Return ¶
func (_c *MockTaskMapper_FindOneById_Call) Return(_a0 *models.Task, _a1 error) *MockTaskMapper_FindOneById_Call
func (*MockTaskMapper_FindOneById_Call) Run ¶
func (_c *MockTaskMapper_FindOneById_Call) Run(run func(ctx context.Context, id string)) *MockTaskMapper_FindOneById_Call
func (*MockTaskMapper_FindOneById_Call) RunAndReturn ¶
func (_c *MockTaskMapper_FindOneById_Call) RunAndReturn(run func(context.Context, string) (*models.Task, error)) *MockTaskMapper_FindOneById_Call
type MockTaskMapper_Find_Call ¶
MockTaskMapper_Find_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Find'
func (*MockTaskMapper_Find_Call) Return ¶
func (_c *MockTaskMapper_Find_Call) Return(_a0 int64, _a1 models.Tasks, _a2 error) *MockTaskMapper_Find_Call
func (*MockTaskMapper_Find_Call) Run ¶
func (_c *MockTaskMapper_Find_Call) Run(run func(ctx context.Context, filter interface{}, limit int, skip int)) *MockTaskMapper_Find_Call
func (*MockTaskMapper_Find_Call) RunAndReturn ¶
func (_c *MockTaskMapper_Find_Call) RunAndReturn(run func(context.Context, interface{}, int, int) (int64, models.Tasks, error)) *MockTaskMapper_Find_Call
type MockTaskMapper_Update_Call ¶
MockTaskMapper_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update'
func (*MockTaskMapper_Update_Call) Return ¶
func (_c *MockTaskMapper_Update_Call) Return(_a0 *models.Task, _a1 error) *MockTaskMapper_Update_Call
func (*MockTaskMapper_Update_Call) Run ¶
func (_c *MockTaskMapper_Update_Call) Run(run func(ctx context.Context, model *models.Task)) *MockTaskMapper_Update_Call
func (*MockTaskMapper_Update_Call) RunAndReturn ¶
func (_c *MockTaskMapper_Update_Call) RunAndReturn(run func(context.Context, *models.Task) (*models.Task, error)) *MockTaskMapper_Update_Call
type MockUserMapper ¶
MockUserMapper is an autogenerated mock type for the UserMapper type
func NewMockUserMapper ¶
func NewMockUserMapper(t interface { mock.TestingT Cleanup(func()) }) *MockUserMapper
NewMockUserMapper creates a new instance of MockUserMapper. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockUserMapper) EXPECT ¶
func (_m *MockUserMapper) EXPECT() *MockUserMapper_Expecter
func (*MockUserMapper) Find ¶
func (_m *MockUserMapper) Find(ctx context.Context, filter interface{}, limit int, skip int) (int64, models.Users, error)
Find provides a mock function with given fields: ctx, filter, limit, skip
type MockUserMapper_Create_Call ¶
MockUserMapper_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create'
func (*MockUserMapper_Create_Call) Return ¶
func (_c *MockUserMapper_Create_Call) Return(_a0 *models.User, _a1 error) *MockUserMapper_Create_Call
func (*MockUserMapper_Create_Call) Run ¶
func (_c *MockUserMapper_Create_Call) Run(run func(ctx context.Context, model *models.User)) *MockUserMapper_Create_Call
func (*MockUserMapper_Create_Call) RunAndReturn ¶
func (_c *MockUserMapper_Create_Call) RunAndReturn(run func(context.Context, *models.User) (*models.User, error)) *MockUserMapper_Create_Call
type MockUserMapper_Expecter ¶
type MockUserMapper_Expecter struct {
// contains filtered or unexported fields
}
func (*MockUserMapper_Expecter) Create ¶
func (_e *MockUserMapper_Expecter) Create(ctx interface{}, model interface{}) *MockUserMapper_Create_Call
Create is a helper method to define mock.On call
- ctx context.Context
- model *models.User
func (*MockUserMapper_Expecter) Find ¶
func (_e *MockUserMapper_Expecter) Find(ctx interface{}, filter interface{}, limit interface{}, skip interface{}) *MockUserMapper_Find_Call
Find is a helper method to define mock.On call
- ctx context.Context
- filter interface{}
- limit int
- skip int
func (*MockUserMapper_Expecter) FindOne ¶
func (_e *MockUserMapper_Expecter) FindOne(ctx interface{}, filter interface{}) *MockUserMapper_FindOne_Call
FindOne is a helper method to define mock.On call
- ctx context.Context
- filter interface{}
func (*MockUserMapper_Expecter) Update ¶
func (_e *MockUserMapper_Expecter) Update(ctx interface{}, model interface{}) *MockUserMapper_Update_Call
Update is a helper method to define mock.On call
- ctx context.Context
- model *models.User
type MockUserMapper_FindOne_Call ¶
MockUserMapper_FindOne_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindOne'
func (*MockUserMapper_FindOne_Call) Return ¶
func (_c *MockUserMapper_FindOne_Call) Return(_a0 *models.User, _a1 error) *MockUserMapper_FindOne_Call
func (*MockUserMapper_FindOne_Call) Run ¶
func (_c *MockUserMapper_FindOne_Call) Run(run func(ctx context.Context, filter interface{})) *MockUserMapper_FindOne_Call
func (*MockUserMapper_FindOne_Call) RunAndReturn ¶
func (_c *MockUserMapper_FindOne_Call) RunAndReturn(run func(context.Context, interface{}) (*models.User, error)) *MockUserMapper_FindOne_Call
type MockUserMapper_Find_Call ¶
MockUserMapper_Find_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Find'
func (*MockUserMapper_Find_Call) Return ¶
func (_c *MockUserMapper_Find_Call) Return(_a0 int64, _a1 models.Users, _a2 error) *MockUserMapper_Find_Call
func (*MockUserMapper_Find_Call) Run ¶
func (_c *MockUserMapper_Find_Call) Run(run func(ctx context.Context, filter interface{}, limit int, skip int)) *MockUserMapper_Find_Call
func (*MockUserMapper_Find_Call) RunAndReturn ¶
func (_c *MockUserMapper_Find_Call) RunAndReturn(run func(context.Context, interface{}, int, int) (int64, models.Users, error)) *MockUserMapper_Find_Call
type MockUserMapper_Update_Call ¶
MockUserMapper_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update'
func (*MockUserMapper_Update_Call) Return ¶
func (_c *MockUserMapper_Update_Call) Return(_a0 *models.User, _a1 error) *MockUserMapper_Update_Call
func (*MockUserMapper_Update_Call) Run ¶
func (_c *MockUserMapper_Update_Call) Run(run func(ctx context.Context, model *models.User)) *MockUserMapper_Update_Call
func (*MockUserMapper_Update_Call) RunAndReturn ¶
func (_c *MockUserMapper_Update_Call) RunAndReturn(run func(context.Context, *models.User) (*models.User, error)) *MockUserMapper_Update_Call
type PersonalAccessToken ¶
type PersonalAccessToken struct {
// contains filtered or unexported fields
}
PersonalAccessToken defines the application service in charge of interacting with Users.
func NewPersonalAccessToken ¶
func NewPersonalAccessToken(mapper PersonalAccessTokenMapper) *PersonalAccessToken
func (*PersonalAccessToken) Create ¶
func (t *PersonalAccessToken) Create(ctx context.Context, model *models.PersonalAccessToken) (*models.PersonalAccessToken, error)
func (*PersonalAccessToken) Find ¶
func (t *PersonalAccessToken) Find(ctx context.Context, userId string) (models.PersonalAccessTokens, error)
func (*PersonalAccessToken) FindOne ¶
func (t *PersonalAccessToken) FindOne(ctx context.Context, userId string, name string) (*models.PersonalAccessToken, error)
func (*PersonalAccessToken) Read ¶
func (t *PersonalAccessToken) Read(ctx context.Context, userId string, id string) (*models.PersonalAccessToken, error)
func (*PersonalAccessToken) Revoke ¶
func (t *PersonalAccessToken) Revoke(ctx context.Context, model *models.PersonalAccessToken) error
type PersonalAccessTokenMapper ¶
type PersonalAccessTokenMapper interface { Create(ctx context.Context, model *models.PersonalAccessToken) (*models.PersonalAccessToken, error) Find(ctx context.Context, filter any) (models.PersonalAccessTokens, error) FindOne(ctx context.Context, filter any) (*models.PersonalAccessToken, error) Update(ctx context.Context, model *models.PersonalAccessToken) (*models.PersonalAccessToken, error) }
PersonalAccessTokenMapper defines the datastore handling persisting User documents.
type Task ¶
type Task struct {
// contains filtered or unexported fields
}
Task defines the application service in charge of interacting with Tasks.
func NewTask ¶
func NewTask(mapper TaskMapper) *Task
type TaskMapper ¶
type TaskMapper interface { Create(ctx context.Context, model *models.Task) (*models.Task, error) Find(ctx context.Context, filter any, limit int, skip int) (int64, models.Tasks, error) FindOneById(ctx context.Context, id string) (*models.Task, error) Update(ctx context.Context, model *models.Task) (*models.Task, error) }
TaskMapper defines the datastore handling persisting Task documents.
type User ¶
type User struct {
// contains filtered or unexported fields
}
User defines the application service in charge of interacting with Users.
func NewUser ¶
func NewUser(mapper UserMapper) *User
func (*User) FindOneByEmailOrUsername ¶
type UserMapper ¶
type UserMapper interface { Create(ctx context.Context, model *models.User) (*models.User, error) Find(ctx context.Context, filter any, limit int, skip int) (int64, models.Users, error) FindOne(ctx context.Context, filter any) (*models.User, error) Update(ctx context.Context, model *models.User) (*models.User, error) }
UserMapper defines the datastore handling persisting User documents.