Documentation
¶
Index ¶
- Variables
- func NewService(repo Repository, sessionManager session.SessionManager) *service
- func ValidateComment(comment string) error
- func ValidateEmail(email string) error
- func ValidatePassword(password string) error
- type MockRepository
- func (_m *MockRepository) CreateUser(ctx context.Context, orgID int64, email string, passwordHash string, ...) (User, error)
- func (_m *MockRepository) DeleteUser(ctx context.Context, id int64, comment string) error
- func (_m *MockRepository) DisableUser(ctx context.Context, id int64, comment string) error
- func (_m *MockRepository) EXPECT() *MockRepository_Expecter
- func (_m *MockRepository) EnableUser(ctx context.Context, id int64, comment string) error
- func (_m *MockRepository) GenerateAPIToken(ctx context.Context, id int64) error
- func (_m *MockRepository) GetUserByAPIToken(ctx context.Context, apiToken string) (User, error)
- func (_m *MockRepository) GetUserByID(ctx context.Context, id int64) (User, error)
- func (_m *MockRepository) GetUserByOrgIDEmail(ctx context.Context, orgID int64, email string) (User, error)
- func (_m *MockRepository) GetUserByOrgSubdomainAPIToken(ctx context.Context, orgSubdomain string, apiToken string) (User, error)
- func (_m *MockRepository) GetUserByOrgSubdomainEmail(ctx context.Context, orgSubdomain string, email string) (User, error)
- func (_m *MockRepository) ResetAPIToken(ctx context.Context, id int64) error
- func (_m *MockRepository) ResetPassword(ctx context.Context, id int64, passwordHash string) error
- func (_m *MockRepository) SetEmailVerified(ctx context.Context, id int64) error
- type MockRepository_CreateUser_Call
- func (_c *MockRepository_CreateUser_Call) Return(_a0 User, _a1 error) *MockRepository_CreateUser_Call
- func (_c *MockRepository_CreateUser_Call) Run(...) *MockRepository_CreateUser_Call
- func (_c *MockRepository_CreateUser_Call) RunAndReturn(run func(context.Context, int64, string, string, bool) (User, error)) *MockRepository_CreateUser_Call
- type MockRepository_DeleteUser_Call
- func (_c *MockRepository_DeleteUser_Call) Return(_a0 error) *MockRepository_DeleteUser_Call
- func (_c *MockRepository_DeleteUser_Call) Run(run func(ctx context.Context, id int64, comment string)) *MockRepository_DeleteUser_Call
- func (_c *MockRepository_DeleteUser_Call) RunAndReturn(run func(context.Context, int64, string) error) *MockRepository_DeleteUser_Call
- type MockRepository_DisableUser_Call
- func (_c *MockRepository_DisableUser_Call) Return(_a0 error) *MockRepository_DisableUser_Call
- func (_c *MockRepository_DisableUser_Call) Run(run func(ctx context.Context, id int64, comment string)) *MockRepository_DisableUser_Call
- func (_c *MockRepository_DisableUser_Call) RunAndReturn(run func(context.Context, int64, string) error) *MockRepository_DisableUser_Call
- type MockRepository_EnableUser_Call
- func (_c *MockRepository_EnableUser_Call) Return(_a0 error) *MockRepository_EnableUser_Call
- func (_c *MockRepository_EnableUser_Call) Run(run func(ctx context.Context, id int64, comment string)) *MockRepository_EnableUser_Call
- func (_c *MockRepository_EnableUser_Call) RunAndReturn(run func(context.Context, int64, string) error) *MockRepository_EnableUser_Call
- type MockRepository_Expecter
- func (_e *MockRepository_Expecter) CreateUser(ctx interface{}, orgID interface{}, email interface{}, ...) *MockRepository_CreateUser_Call
- func (_e *MockRepository_Expecter) DeleteUser(ctx interface{}, id interface{}, comment interface{}) *MockRepository_DeleteUser_Call
- func (_e *MockRepository_Expecter) DisableUser(ctx interface{}, id interface{}, comment interface{}) *MockRepository_DisableUser_Call
- func (_e *MockRepository_Expecter) EnableUser(ctx interface{}, id interface{}, comment interface{}) *MockRepository_EnableUser_Call
- func (_e *MockRepository_Expecter) GenerateAPIToken(ctx interface{}, id interface{}) *MockRepository_GenerateAPIToken_Call
- func (_e *MockRepository_Expecter) GetUserByAPIToken(ctx interface{}, apiToken interface{}) *MockRepository_GetUserByAPIToken_Call
- func (_e *MockRepository_Expecter) GetUserByID(ctx interface{}, id interface{}) *MockRepository_GetUserByID_Call
- func (_e *MockRepository_Expecter) GetUserByOrgIDEmail(ctx interface{}, orgID interface{}, email interface{}) *MockRepository_GetUserByOrgIDEmail_Call
- func (_e *MockRepository_Expecter) GetUserByOrgSubdomainAPIToken(ctx interface{}, orgSubdomain interface{}, apiToken interface{}) *MockRepository_GetUserByOrgSubdomainAPIToken_Call
- func (_e *MockRepository_Expecter) GetUserByOrgSubdomainEmail(ctx interface{}, orgSubdomain interface{}, email interface{}) *MockRepository_GetUserByOrgSubdomainEmail_Call
- func (_e *MockRepository_Expecter) ResetAPIToken(ctx interface{}, id interface{}) *MockRepository_ResetAPIToken_Call
- func (_e *MockRepository_Expecter) ResetPassword(ctx interface{}, id interface{}, passwordHash interface{}) *MockRepository_ResetPassword_Call
- func (_e *MockRepository_Expecter) SetEmailVerified(ctx interface{}, id interface{}) *MockRepository_SetEmailVerified_Call
- type MockRepository_GenerateAPIToken_Call
- func (_c *MockRepository_GenerateAPIToken_Call) Return(_a0 error) *MockRepository_GenerateAPIToken_Call
- func (_c *MockRepository_GenerateAPIToken_Call) Run(run func(ctx context.Context, id int64)) *MockRepository_GenerateAPIToken_Call
- func (_c *MockRepository_GenerateAPIToken_Call) RunAndReturn(run func(context.Context, int64) error) *MockRepository_GenerateAPIToken_Call
- type MockRepository_GetUserByAPIToken_Call
- func (_c *MockRepository_GetUserByAPIToken_Call) Return(_a0 User, _a1 error) *MockRepository_GetUserByAPIToken_Call
- func (_c *MockRepository_GetUserByAPIToken_Call) Run(run func(ctx context.Context, apiToken string)) *MockRepository_GetUserByAPIToken_Call
- func (_c *MockRepository_GetUserByAPIToken_Call) RunAndReturn(run func(context.Context, string) (User, error)) *MockRepository_GetUserByAPIToken_Call
- type MockRepository_GetUserByID_Call
- func (_c *MockRepository_GetUserByID_Call) Return(_a0 User, _a1 error) *MockRepository_GetUserByID_Call
- func (_c *MockRepository_GetUserByID_Call) Run(run func(ctx context.Context, id int64)) *MockRepository_GetUserByID_Call
- func (_c *MockRepository_GetUserByID_Call) RunAndReturn(run func(context.Context, int64) (User, error)) *MockRepository_GetUserByID_Call
- type MockRepository_GetUserByOrgIDEmail_Call
- func (_c *MockRepository_GetUserByOrgIDEmail_Call) Return(_a0 User, _a1 error) *MockRepository_GetUserByOrgIDEmail_Call
- func (_c *MockRepository_GetUserByOrgIDEmail_Call) Run(run func(ctx context.Context, orgID int64, email string)) *MockRepository_GetUserByOrgIDEmail_Call
- func (_c *MockRepository_GetUserByOrgIDEmail_Call) RunAndReturn(run func(context.Context, int64, string) (User, error)) *MockRepository_GetUserByOrgIDEmail_Call
- type MockRepository_GetUserByOrgSubdomainAPIToken_Call
- func (_c *MockRepository_GetUserByOrgSubdomainAPIToken_Call) Return(_a0 User, _a1 error) *MockRepository_GetUserByOrgSubdomainAPIToken_Call
- func (_c *MockRepository_GetUserByOrgSubdomainAPIToken_Call) Run(run func(ctx context.Context, orgSubdomain string, apiToken string)) *MockRepository_GetUserByOrgSubdomainAPIToken_Call
- func (_c *MockRepository_GetUserByOrgSubdomainAPIToken_Call) RunAndReturn(run func(context.Context, string, string) (User, error)) *MockRepository_GetUserByOrgSubdomainAPIToken_Call
- type MockRepository_GetUserByOrgSubdomainEmail_Call
- func (_c *MockRepository_GetUserByOrgSubdomainEmail_Call) Return(_a0 User, _a1 error) *MockRepository_GetUserByOrgSubdomainEmail_Call
- func (_c *MockRepository_GetUserByOrgSubdomainEmail_Call) Run(run func(ctx context.Context, orgSubdomain string, email string)) *MockRepository_GetUserByOrgSubdomainEmail_Call
- func (_c *MockRepository_GetUserByOrgSubdomainEmail_Call) RunAndReturn(run func(context.Context, string, string) (User, error)) *MockRepository_GetUserByOrgSubdomainEmail_Call
- type MockRepository_ResetAPIToken_Call
- func (_c *MockRepository_ResetAPIToken_Call) Return(_a0 error) *MockRepository_ResetAPIToken_Call
- func (_c *MockRepository_ResetAPIToken_Call) Run(run func(ctx context.Context, id int64)) *MockRepository_ResetAPIToken_Call
- func (_c *MockRepository_ResetAPIToken_Call) RunAndReturn(run func(context.Context, int64) error) *MockRepository_ResetAPIToken_Call
- type MockRepository_ResetPassword_Call
- func (_c *MockRepository_ResetPassword_Call) Return(_a0 error) *MockRepository_ResetPassword_Call
- func (_c *MockRepository_ResetPassword_Call) Run(run func(ctx context.Context, id int64, passwordHash string)) *MockRepository_ResetPassword_Call
- func (_c *MockRepository_ResetPassword_Call) RunAndReturn(run func(context.Context, int64, string) error) *MockRepository_ResetPassword_Call
- type MockRepository_SetEmailVerified_Call
- func (_c *MockRepository_SetEmailVerified_Call) Return(_a0 error) *MockRepository_SetEmailVerified_Call
- func (_c *MockRepository_SetEmailVerified_Call) Run(run func(ctx context.Context, id int64)) *MockRepository_SetEmailVerified_Call
- func (_c *MockRepository_SetEmailVerified_Call) RunAndReturn(run func(context.Context, int64) error) *MockRepository_SetEmailVerified_Call
- type MockService
- func (_m *MockService) CreateOwner(ctx context.Context, orgID int64, email string, password string) (User, error)
- func (_m *MockService) CreateUser(ctx context.Context, orgID int64, email string, password string) (User, error)
- func (_m *MockService) DeleteUser(ctx context.Context, id int64, comment string) error
- func (_m *MockService) DisableUser(ctx context.Context, id int64, comment string) error
- func (_m *MockService) EXPECT() *MockService_Expecter
- func (_m *MockService) EnableUser(ctx context.Context, id int64, comment string) error
- func (_m *MockService) GenerateAPIToken(ctx context.Context, id int64) error
- func (_m *MockService) GetUserByAPIToken(ctx context.Context, apiToken string) (User, error)
- func (_m *MockService) GetUserByID(ctx context.Context, id int64) (User, error)
- func (_m *MockService) GetUserByOrgIDEmail(ctx context.Context, orgID int64, email string) (User, error)
- func (_m *MockService) GetUserByOrgSubdomainAPIToken(ctx context.Context, orgSubdomain string, apiToken string) (User, error)
- func (_m *MockService) GetUserByOrgSubdomainEmail(ctx context.Context, orgSubdomain string, email string) (User, error)
- func (_m *MockService) ResetAPIToken(ctx context.Context, id int64) error
- func (_m *MockService) ResetPassword(ctx context.Context, id int64, newPassword string) error
- func (_m *MockService) SetEmailVerified(ctx context.Context, id int64) error
- type MockService_CreateOwner_Call
- func (_c *MockService_CreateOwner_Call) Return(_a0 User, _a1 error) *MockService_CreateOwner_Call
- func (_c *MockService_CreateOwner_Call) Run(run func(ctx context.Context, orgID int64, email string, password string)) *MockService_CreateOwner_Call
- func (_c *MockService_CreateOwner_Call) RunAndReturn(run func(context.Context, int64, string, string) (User, error)) *MockService_CreateOwner_Call
- type MockService_CreateUser_Call
- func (_c *MockService_CreateUser_Call) Return(_a0 User, _a1 error) *MockService_CreateUser_Call
- func (_c *MockService_CreateUser_Call) Run(run func(ctx context.Context, orgID int64, email string, password string)) *MockService_CreateUser_Call
- func (_c *MockService_CreateUser_Call) RunAndReturn(run func(context.Context, int64, string, string) (User, error)) *MockService_CreateUser_Call
- type MockService_DeleteUser_Call
- func (_c *MockService_DeleteUser_Call) Return(_a0 error) *MockService_DeleteUser_Call
- func (_c *MockService_DeleteUser_Call) Run(run func(ctx context.Context, id int64, comment string)) *MockService_DeleteUser_Call
- func (_c *MockService_DeleteUser_Call) RunAndReturn(run func(context.Context, int64, string) error) *MockService_DeleteUser_Call
- type MockService_DisableUser_Call
- func (_c *MockService_DisableUser_Call) Return(_a0 error) *MockService_DisableUser_Call
- func (_c *MockService_DisableUser_Call) Run(run func(ctx context.Context, id int64, comment string)) *MockService_DisableUser_Call
- func (_c *MockService_DisableUser_Call) RunAndReturn(run func(context.Context, int64, string) error) *MockService_DisableUser_Call
- type MockService_EnableUser_Call
- func (_c *MockService_EnableUser_Call) Return(_a0 error) *MockService_EnableUser_Call
- func (_c *MockService_EnableUser_Call) Run(run func(ctx context.Context, id int64, comment string)) *MockService_EnableUser_Call
- func (_c *MockService_EnableUser_Call) RunAndReturn(run func(context.Context, int64, string) error) *MockService_EnableUser_Call
- type MockService_Expecter
- func (_e *MockService_Expecter) CreateOwner(ctx interface{}, orgID interface{}, email interface{}, password interface{}) *MockService_CreateOwner_Call
- func (_e *MockService_Expecter) CreateUser(ctx interface{}, orgID interface{}, email interface{}, password interface{}) *MockService_CreateUser_Call
- func (_e *MockService_Expecter) DeleteUser(ctx interface{}, id interface{}, comment interface{}) *MockService_DeleteUser_Call
- func (_e *MockService_Expecter) DisableUser(ctx interface{}, id interface{}, comment interface{}) *MockService_DisableUser_Call
- func (_e *MockService_Expecter) EnableUser(ctx interface{}, id interface{}, comment interface{}) *MockService_EnableUser_Call
- func (_e *MockService_Expecter) GenerateAPIToken(ctx interface{}, id interface{}) *MockService_GenerateAPIToken_Call
- func (_e *MockService_Expecter) GetUserByAPIToken(ctx interface{}, apiToken interface{}) *MockService_GetUserByAPIToken_Call
- func (_e *MockService_Expecter) GetUserByID(ctx interface{}, id interface{}) *MockService_GetUserByID_Call
- func (_e *MockService_Expecter) GetUserByOrgIDEmail(ctx interface{}, orgID interface{}, email interface{}) *MockService_GetUserByOrgIDEmail_Call
- func (_e *MockService_Expecter) GetUserByOrgSubdomainAPIToken(ctx interface{}, orgSubdomain interface{}, apiToken interface{}) *MockService_GetUserByOrgSubdomainAPIToken_Call
- func (_e *MockService_Expecter) GetUserByOrgSubdomainEmail(ctx interface{}, orgSubdomain interface{}, email interface{}) *MockService_GetUserByOrgSubdomainEmail_Call
- func (_e *MockService_Expecter) ResetAPIToken(ctx interface{}, id interface{}) *MockService_ResetAPIToken_Call
- func (_e *MockService_Expecter) ResetPassword(ctx interface{}, id interface{}, newPassword interface{}) *MockService_ResetPassword_Call
- func (_e *MockService_Expecter) SetEmailVerified(ctx interface{}, id interface{}) *MockService_SetEmailVerified_Call
- type MockService_GenerateAPIToken_Call
- func (_c *MockService_GenerateAPIToken_Call) Return(_a0 error) *MockService_GenerateAPIToken_Call
- func (_c *MockService_GenerateAPIToken_Call) Run(run func(ctx context.Context, id int64)) *MockService_GenerateAPIToken_Call
- func (_c *MockService_GenerateAPIToken_Call) RunAndReturn(run func(context.Context, int64) error) *MockService_GenerateAPIToken_Call
- type MockService_GetUserByAPIToken_Call
- func (_c *MockService_GetUserByAPIToken_Call) Return(_a0 User, _a1 error) *MockService_GetUserByAPIToken_Call
- func (_c *MockService_GetUserByAPIToken_Call) Run(run func(ctx context.Context, apiToken string)) *MockService_GetUserByAPIToken_Call
- func (_c *MockService_GetUserByAPIToken_Call) RunAndReturn(run func(context.Context, string) (User, error)) *MockService_GetUserByAPIToken_Call
- type MockService_GetUserByID_Call
- func (_c *MockService_GetUserByID_Call) Return(_a0 User, _a1 error) *MockService_GetUserByID_Call
- func (_c *MockService_GetUserByID_Call) Run(run func(ctx context.Context, id int64)) *MockService_GetUserByID_Call
- func (_c *MockService_GetUserByID_Call) RunAndReturn(run func(context.Context, int64) (User, error)) *MockService_GetUserByID_Call
- type MockService_GetUserByOrgIDEmail_Call
- func (_c *MockService_GetUserByOrgIDEmail_Call) Return(_a0 User, _a1 error) *MockService_GetUserByOrgIDEmail_Call
- func (_c *MockService_GetUserByOrgIDEmail_Call) Run(run func(ctx context.Context, orgID int64, email string)) *MockService_GetUserByOrgIDEmail_Call
- func (_c *MockService_GetUserByOrgIDEmail_Call) RunAndReturn(run func(context.Context, int64, string) (User, error)) *MockService_GetUserByOrgIDEmail_Call
- type MockService_GetUserByOrgSubdomainAPIToken_Call
- func (_c *MockService_GetUserByOrgSubdomainAPIToken_Call) Return(_a0 User, _a1 error) *MockService_GetUserByOrgSubdomainAPIToken_Call
- func (_c *MockService_GetUserByOrgSubdomainAPIToken_Call) Run(run func(ctx context.Context, orgSubdomain string, apiToken string)) *MockService_GetUserByOrgSubdomainAPIToken_Call
- func (_c *MockService_GetUserByOrgSubdomainAPIToken_Call) RunAndReturn(run func(context.Context, string, string) (User, error)) *MockService_GetUserByOrgSubdomainAPIToken_Call
- type MockService_GetUserByOrgSubdomainEmail_Call
- func (_c *MockService_GetUserByOrgSubdomainEmail_Call) Return(_a0 User, _a1 error) *MockService_GetUserByOrgSubdomainEmail_Call
- func (_c *MockService_GetUserByOrgSubdomainEmail_Call) Run(run func(ctx context.Context, orgSubdomain string, email string)) *MockService_GetUserByOrgSubdomainEmail_Call
- func (_c *MockService_GetUserByOrgSubdomainEmail_Call) RunAndReturn(run func(context.Context, string, string) (User, error)) *MockService_GetUserByOrgSubdomainEmail_Call
- type MockService_ResetAPIToken_Call
- func (_c *MockService_ResetAPIToken_Call) Return(_a0 error) *MockService_ResetAPIToken_Call
- func (_c *MockService_ResetAPIToken_Call) Run(run func(ctx context.Context, id int64)) *MockService_ResetAPIToken_Call
- func (_c *MockService_ResetAPIToken_Call) RunAndReturn(run func(context.Context, int64) error) *MockService_ResetAPIToken_Call
- type MockService_ResetPassword_Call
- func (_c *MockService_ResetPassword_Call) Return(_a0 error) *MockService_ResetPassword_Call
- func (_c *MockService_ResetPassword_Call) Run(run func(ctx context.Context, id int64, newPassword string)) *MockService_ResetPassword_Call
- func (_c *MockService_ResetPassword_Call) RunAndReturn(run func(context.Context, int64, string) error) *MockService_ResetPassword_Call
- type MockService_SetEmailVerified_Call
- func (_c *MockService_SetEmailVerified_Call) Return(_a0 error) *MockService_SetEmailVerified_Call
- func (_c *MockService_SetEmailVerified_Call) Run(run func(ctx context.Context, id int64)) *MockService_SetEmailVerified_Call
- func (_c *MockService_SetEmailVerified_Call) RunAndReturn(run func(context.Context, int64) error) *MockService_SetEmailVerified_Call
- type Repository
- type Service
- type User
Constants ¶
This section is empty.
Variables ¶
var ErrUserIsOwner = errors.New("operation not allowed. user is owner")
Functions ¶
func NewService ¶
func NewService(repo Repository, sessionManager session.SessionManager) *service
NewService creates a new user service.
func ValidateComment ¶
ValidateComment validates the comment string.
func ValidateEmail ¶
ValidateEmail validates the email string.
func ValidatePassword ¶
ValidatePassword validates the password string.
Types ¶
type MockRepository ¶
MockRepository is an autogenerated mock type for the Repository type
func NewMockRepository ¶
func NewMockRepository(t interface { mock.TestingT Cleanup(func()) }) *MockRepository
NewMockRepository creates a new instance of MockRepository. 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 (*MockRepository) CreateUser ¶
func (_m *MockRepository) CreateUser(ctx context.Context, orgID int64, email string, passwordHash string, isOwner bool) (User, error)
CreateUser provides a mock function with given fields: ctx, orgID, email, passwordHash, isOwner
func (*MockRepository) DeleteUser ¶
DeleteUser provides a mock function with given fields: ctx, id, comment
func (*MockRepository) DisableUser ¶
DisableUser provides a mock function with given fields: ctx, id, comment
func (*MockRepository) EXPECT ¶
func (_m *MockRepository) EXPECT() *MockRepository_Expecter
func (*MockRepository) EnableUser ¶
EnableUser provides a mock function with given fields: ctx, id, comment
func (*MockRepository) GenerateAPIToken ¶
func (_m *MockRepository) GenerateAPIToken(ctx context.Context, id int64) error
GenerateAPIToken provides a mock function with given fields: ctx, id
func (*MockRepository) GetUserByAPIToken ¶
GetUserByAPIToken provides a mock function with given fields: ctx, apiToken
func (*MockRepository) GetUserByID ¶
GetUserByID provides a mock function with given fields: ctx, id
func (*MockRepository) GetUserByOrgIDEmail ¶
func (_m *MockRepository) GetUserByOrgIDEmail(ctx context.Context, orgID int64, email string) (User, error)
GetUserByOrgIDEmail provides a mock function with given fields: ctx, orgID, email
func (*MockRepository) GetUserByOrgSubdomainAPIToken ¶
func (_m *MockRepository) GetUserByOrgSubdomainAPIToken(ctx context.Context, orgSubdomain string, apiToken string) (User, error)
GetUserByOrgSubdomainAPIToken provides a mock function with given fields: ctx, orgSubdomain, apiToken
func (*MockRepository) GetUserByOrgSubdomainEmail ¶
func (_m *MockRepository) GetUserByOrgSubdomainEmail(ctx context.Context, orgSubdomain string, email string) (User, error)
GetUserByOrgSubdomainEmail provides a mock function with given fields: ctx, orgSubdomain, email
func (*MockRepository) ResetAPIToken ¶
func (_m *MockRepository) ResetAPIToken(ctx context.Context, id int64) error
ResetAPIToken provides a mock function with given fields: ctx, id
func (*MockRepository) ResetPassword ¶
ResetPassword provides a mock function with given fields: ctx, id, passwordHash
func (*MockRepository) SetEmailVerified ¶
func (_m *MockRepository) SetEmailVerified(ctx context.Context, id int64) error
SetEmailVerified provides a mock function with given fields: ctx, id
type MockRepository_CreateUser_Call ¶
MockRepository_CreateUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateUser'
func (*MockRepository_CreateUser_Call) Return ¶
func (_c *MockRepository_CreateUser_Call) Return(_a0 User, _a1 error) *MockRepository_CreateUser_Call
func (*MockRepository_CreateUser_Call) Run ¶
func (_c *MockRepository_CreateUser_Call) Run(run func(ctx context.Context, orgID int64, email string, passwordHash string, isOwner bool)) *MockRepository_CreateUser_Call
func (*MockRepository_CreateUser_Call) RunAndReturn ¶
func (_c *MockRepository_CreateUser_Call) RunAndReturn(run func(context.Context, int64, string, string, bool) (User, error)) *MockRepository_CreateUser_Call
type MockRepository_DeleteUser_Call ¶
MockRepository_DeleteUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteUser'
func (*MockRepository_DeleteUser_Call) Return ¶
func (_c *MockRepository_DeleteUser_Call) Return(_a0 error) *MockRepository_DeleteUser_Call
func (*MockRepository_DeleteUser_Call) Run ¶
func (_c *MockRepository_DeleteUser_Call) Run(run func(ctx context.Context, id int64, comment string)) *MockRepository_DeleteUser_Call
func (*MockRepository_DeleteUser_Call) RunAndReturn ¶
func (_c *MockRepository_DeleteUser_Call) RunAndReturn(run func(context.Context, int64, string) error) *MockRepository_DeleteUser_Call
type MockRepository_DisableUser_Call ¶
MockRepository_DisableUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DisableUser'
func (*MockRepository_DisableUser_Call) Return ¶
func (_c *MockRepository_DisableUser_Call) Return(_a0 error) *MockRepository_DisableUser_Call
func (*MockRepository_DisableUser_Call) Run ¶
func (_c *MockRepository_DisableUser_Call) Run(run func(ctx context.Context, id int64, comment string)) *MockRepository_DisableUser_Call
func (*MockRepository_DisableUser_Call) RunAndReturn ¶
func (_c *MockRepository_DisableUser_Call) RunAndReturn(run func(context.Context, int64, string) error) *MockRepository_DisableUser_Call
type MockRepository_EnableUser_Call ¶
MockRepository_EnableUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnableUser'
func (*MockRepository_EnableUser_Call) Return ¶
func (_c *MockRepository_EnableUser_Call) Return(_a0 error) *MockRepository_EnableUser_Call
func (*MockRepository_EnableUser_Call) Run ¶
func (_c *MockRepository_EnableUser_Call) Run(run func(ctx context.Context, id int64, comment string)) *MockRepository_EnableUser_Call
func (*MockRepository_EnableUser_Call) RunAndReturn ¶
func (_c *MockRepository_EnableUser_Call) RunAndReturn(run func(context.Context, int64, string) error) *MockRepository_EnableUser_Call
type MockRepository_Expecter ¶
type MockRepository_Expecter struct {
// contains filtered or unexported fields
}
func (*MockRepository_Expecter) CreateUser ¶
func (_e *MockRepository_Expecter) CreateUser(ctx interface{}, orgID interface{}, email interface{}, passwordHash interface{}, isOwner interface{}) *MockRepository_CreateUser_Call
CreateUser is a helper method to define mock.On call
- ctx context.Context
- orgID int64
- email string
- passwordHash string
- isOwner bool
func (*MockRepository_Expecter) DeleteUser ¶
func (_e *MockRepository_Expecter) DeleteUser(ctx interface{}, id interface{}, comment interface{}) *MockRepository_DeleteUser_Call
DeleteUser is a helper method to define mock.On call
- ctx context.Context
- id int64
- comment string
func (*MockRepository_Expecter) DisableUser ¶
func (_e *MockRepository_Expecter) DisableUser(ctx interface{}, id interface{}, comment interface{}) *MockRepository_DisableUser_Call
DisableUser is a helper method to define mock.On call
- ctx context.Context
- id int64
- comment string
func (*MockRepository_Expecter) EnableUser ¶
func (_e *MockRepository_Expecter) EnableUser(ctx interface{}, id interface{}, comment interface{}) *MockRepository_EnableUser_Call
EnableUser is a helper method to define mock.On call
- ctx context.Context
- id int64
- comment string
func (*MockRepository_Expecter) GenerateAPIToken ¶
func (_e *MockRepository_Expecter) GenerateAPIToken(ctx interface{}, id interface{}) *MockRepository_GenerateAPIToken_Call
GenerateAPIToken is a helper method to define mock.On call
- ctx context.Context
- id int64
func (*MockRepository_Expecter) GetUserByAPIToken ¶
func (_e *MockRepository_Expecter) GetUserByAPIToken(ctx interface{}, apiToken interface{}) *MockRepository_GetUserByAPIToken_Call
GetUserByAPIToken is a helper method to define mock.On call
- ctx context.Context
- apiToken string
func (*MockRepository_Expecter) GetUserByID ¶
func (_e *MockRepository_Expecter) GetUserByID(ctx interface{}, id interface{}) *MockRepository_GetUserByID_Call
GetUserByID is a helper method to define mock.On call
- ctx context.Context
- id int64
func (*MockRepository_Expecter) GetUserByOrgIDEmail ¶
func (_e *MockRepository_Expecter) GetUserByOrgIDEmail(ctx interface{}, orgID interface{}, email interface{}) *MockRepository_GetUserByOrgIDEmail_Call
GetUserByOrgIDEmail is a helper method to define mock.On call
- ctx context.Context
- orgID int64
- email string
func (*MockRepository_Expecter) GetUserByOrgSubdomainAPIToken ¶
func (_e *MockRepository_Expecter) GetUserByOrgSubdomainAPIToken(ctx interface{}, orgSubdomain interface{}, apiToken interface{}) *MockRepository_GetUserByOrgSubdomainAPIToken_Call
GetUserByOrgSubdomainAPIToken is a helper method to define mock.On call
- ctx context.Context
- orgSubdomain string
- apiToken string
func (*MockRepository_Expecter) GetUserByOrgSubdomainEmail ¶
func (_e *MockRepository_Expecter) GetUserByOrgSubdomainEmail(ctx interface{}, orgSubdomain interface{}, email interface{}) *MockRepository_GetUserByOrgSubdomainEmail_Call
GetUserByOrgSubdomainEmail is a helper method to define mock.On call
- ctx context.Context
- orgSubdomain string
- email string
func (*MockRepository_Expecter) ResetAPIToken ¶
func (_e *MockRepository_Expecter) ResetAPIToken(ctx interface{}, id interface{}) *MockRepository_ResetAPIToken_Call
ResetAPIToken is a helper method to define mock.On call
- ctx context.Context
- id int64
func (*MockRepository_Expecter) ResetPassword ¶
func (_e *MockRepository_Expecter) ResetPassword(ctx interface{}, id interface{}, passwordHash interface{}) *MockRepository_ResetPassword_Call
ResetPassword is a helper method to define mock.On call
- ctx context.Context
- id int64
- passwordHash string
func (*MockRepository_Expecter) SetEmailVerified ¶
func (_e *MockRepository_Expecter) SetEmailVerified(ctx interface{}, id interface{}) *MockRepository_SetEmailVerified_Call
SetEmailVerified is a helper method to define mock.On call
- ctx context.Context
- id int64
type MockRepository_GenerateAPIToken_Call ¶
MockRepository_GenerateAPIToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GenerateAPIToken'
func (*MockRepository_GenerateAPIToken_Call) Return ¶
func (_c *MockRepository_GenerateAPIToken_Call) Return(_a0 error) *MockRepository_GenerateAPIToken_Call
func (*MockRepository_GenerateAPIToken_Call) Run ¶
func (_c *MockRepository_GenerateAPIToken_Call) Run(run func(ctx context.Context, id int64)) *MockRepository_GenerateAPIToken_Call
func (*MockRepository_GenerateAPIToken_Call) RunAndReturn ¶
func (_c *MockRepository_GenerateAPIToken_Call) RunAndReturn(run func(context.Context, int64) error) *MockRepository_GenerateAPIToken_Call
type MockRepository_GetUserByAPIToken_Call ¶
MockRepository_GetUserByAPIToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUserByAPIToken'
func (*MockRepository_GetUserByAPIToken_Call) Return ¶
func (_c *MockRepository_GetUserByAPIToken_Call) Return(_a0 User, _a1 error) *MockRepository_GetUserByAPIToken_Call
func (*MockRepository_GetUserByAPIToken_Call) Run ¶
func (_c *MockRepository_GetUserByAPIToken_Call) Run(run func(ctx context.Context, apiToken string)) *MockRepository_GetUserByAPIToken_Call
func (*MockRepository_GetUserByAPIToken_Call) RunAndReturn ¶
func (_c *MockRepository_GetUserByAPIToken_Call) RunAndReturn(run func(context.Context, string) (User, error)) *MockRepository_GetUserByAPIToken_Call
type MockRepository_GetUserByID_Call ¶
MockRepository_GetUserByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUserByID'
func (*MockRepository_GetUserByID_Call) Return ¶
func (_c *MockRepository_GetUserByID_Call) Return(_a0 User, _a1 error) *MockRepository_GetUserByID_Call
func (*MockRepository_GetUserByID_Call) Run ¶
func (_c *MockRepository_GetUserByID_Call) Run(run func(ctx context.Context, id int64)) *MockRepository_GetUserByID_Call
func (*MockRepository_GetUserByID_Call) RunAndReturn ¶
func (_c *MockRepository_GetUserByID_Call) RunAndReturn(run func(context.Context, int64) (User, error)) *MockRepository_GetUserByID_Call
type MockRepository_GetUserByOrgIDEmail_Call ¶
MockRepository_GetUserByOrgIDEmail_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUserByOrgIDEmail'
func (*MockRepository_GetUserByOrgIDEmail_Call) Return ¶
func (_c *MockRepository_GetUserByOrgIDEmail_Call) Return(_a0 User, _a1 error) *MockRepository_GetUserByOrgIDEmail_Call
func (*MockRepository_GetUserByOrgIDEmail_Call) Run ¶
func (_c *MockRepository_GetUserByOrgIDEmail_Call) Run(run func(ctx context.Context, orgID int64, email string)) *MockRepository_GetUserByOrgIDEmail_Call
func (*MockRepository_GetUserByOrgIDEmail_Call) RunAndReturn ¶
func (_c *MockRepository_GetUserByOrgIDEmail_Call) RunAndReturn(run func(context.Context, int64, string) (User, error)) *MockRepository_GetUserByOrgIDEmail_Call
type MockRepository_GetUserByOrgSubdomainAPIToken_Call ¶
MockRepository_GetUserByOrgSubdomainAPIToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUserByOrgSubdomainAPIToken'
func (*MockRepository_GetUserByOrgSubdomainAPIToken_Call) Return ¶
func (_c *MockRepository_GetUserByOrgSubdomainAPIToken_Call) Return(_a0 User, _a1 error) *MockRepository_GetUserByOrgSubdomainAPIToken_Call
func (*MockRepository_GetUserByOrgSubdomainAPIToken_Call) Run ¶
func (_c *MockRepository_GetUserByOrgSubdomainAPIToken_Call) Run(run func(ctx context.Context, orgSubdomain string, apiToken string)) *MockRepository_GetUserByOrgSubdomainAPIToken_Call
func (*MockRepository_GetUserByOrgSubdomainAPIToken_Call) RunAndReturn ¶
func (_c *MockRepository_GetUserByOrgSubdomainAPIToken_Call) RunAndReturn(run func(context.Context, string, string) (User, error)) *MockRepository_GetUserByOrgSubdomainAPIToken_Call
type MockRepository_GetUserByOrgSubdomainEmail_Call ¶
MockRepository_GetUserByOrgSubdomainEmail_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUserByOrgSubdomainEmail'
func (*MockRepository_GetUserByOrgSubdomainEmail_Call) Return ¶
func (_c *MockRepository_GetUserByOrgSubdomainEmail_Call) Return(_a0 User, _a1 error) *MockRepository_GetUserByOrgSubdomainEmail_Call
func (*MockRepository_GetUserByOrgSubdomainEmail_Call) Run ¶
func (_c *MockRepository_GetUserByOrgSubdomainEmail_Call) Run(run func(ctx context.Context, orgSubdomain string, email string)) *MockRepository_GetUserByOrgSubdomainEmail_Call
func (*MockRepository_GetUserByOrgSubdomainEmail_Call) RunAndReturn ¶
func (_c *MockRepository_GetUserByOrgSubdomainEmail_Call) RunAndReturn(run func(context.Context, string, string) (User, error)) *MockRepository_GetUserByOrgSubdomainEmail_Call
type MockRepository_ResetAPIToken_Call ¶
MockRepository_ResetAPIToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ResetAPIToken'
func (*MockRepository_ResetAPIToken_Call) Return ¶
func (_c *MockRepository_ResetAPIToken_Call) Return(_a0 error) *MockRepository_ResetAPIToken_Call
func (*MockRepository_ResetAPIToken_Call) Run ¶
func (_c *MockRepository_ResetAPIToken_Call) Run(run func(ctx context.Context, id int64)) *MockRepository_ResetAPIToken_Call
func (*MockRepository_ResetAPIToken_Call) RunAndReturn ¶
func (_c *MockRepository_ResetAPIToken_Call) RunAndReturn(run func(context.Context, int64) error) *MockRepository_ResetAPIToken_Call
type MockRepository_ResetPassword_Call ¶
MockRepository_ResetPassword_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ResetPassword'
func (*MockRepository_ResetPassword_Call) Return ¶
func (_c *MockRepository_ResetPassword_Call) Return(_a0 error) *MockRepository_ResetPassword_Call
func (*MockRepository_ResetPassword_Call) Run ¶
func (_c *MockRepository_ResetPassword_Call) Run(run func(ctx context.Context, id int64, passwordHash string)) *MockRepository_ResetPassword_Call
func (*MockRepository_ResetPassword_Call) RunAndReturn ¶
func (_c *MockRepository_ResetPassword_Call) RunAndReturn(run func(context.Context, int64, string) error) *MockRepository_ResetPassword_Call
type MockRepository_SetEmailVerified_Call ¶
MockRepository_SetEmailVerified_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetEmailVerified'
func (*MockRepository_SetEmailVerified_Call) Return ¶
func (_c *MockRepository_SetEmailVerified_Call) Return(_a0 error) *MockRepository_SetEmailVerified_Call
func (*MockRepository_SetEmailVerified_Call) Run ¶
func (_c *MockRepository_SetEmailVerified_Call) Run(run func(ctx context.Context, id int64)) *MockRepository_SetEmailVerified_Call
func (*MockRepository_SetEmailVerified_Call) RunAndReturn ¶
func (_c *MockRepository_SetEmailVerified_Call) RunAndReturn(run func(context.Context, int64) error) *MockRepository_SetEmailVerified_Call
type MockService ¶
MockService is an autogenerated mock type for the Service type
func NewMockService ¶
func NewMockService(t interface { mock.TestingT Cleanup(func()) }) *MockService
NewMockService creates a new instance of MockService. 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 (*MockService) CreateOwner ¶
func (_m *MockService) CreateOwner(ctx context.Context, orgID int64, email string, password string) (User, error)
CreateOwner provides a mock function with given fields: ctx, orgID, email, password
func (*MockService) CreateUser ¶
func (_m *MockService) CreateUser(ctx context.Context, orgID int64, email string, password string) (User, error)
CreateUser provides a mock function with given fields: ctx, orgID, email, password
func (*MockService) DeleteUser ¶
DeleteUser provides a mock function with given fields: ctx, id, comment
func (*MockService) DisableUser ¶
DisableUser provides a mock function with given fields: ctx, id, comment
func (*MockService) EXPECT ¶
func (_m *MockService) EXPECT() *MockService_Expecter
func (*MockService) EnableUser ¶
EnableUser provides a mock function with given fields: ctx, id, comment
func (*MockService) GenerateAPIToken ¶
func (_m *MockService) GenerateAPIToken(ctx context.Context, id int64) error
GenerateAPIToken provides a mock function with given fields: ctx, id
func (*MockService) GetUserByAPIToken ¶
GetUserByAPIToken provides a mock function with given fields: ctx, apiToken
func (*MockService) GetUserByID ¶
GetUserByID provides a mock function with given fields: ctx, id
func (*MockService) GetUserByOrgIDEmail ¶
func (_m *MockService) GetUserByOrgIDEmail(ctx context.Context, orgID int64, email string) (User, error)
GetUserByOrgIDEmail provides a mock function with given fields: ctx, orgID, email
func (*MockService) GetUserByOrgSubdomainAPIToken ¶
func (_m *MockService) GetUserByOrgSubdomainAPIToken(ctx context.Context, orgSubdomain string, apiToken string) (User, error)
GetUserByOrgSubdomainAPIToken provides a mock function with given fields: ctx, orgSubdomain, apiToken
func (*MockService) GetUserByOrgSubdomainEmail ¶
func (_m *MockService) GetUserByOrgSubdomainEmail(ctx context.Context, orgSubdomain string, email string) (User, error)
GetUserByOrgSubdomainEmail provides a mock function with given fields: ctx, orgSubdomain, email
func (*MockService) ResetAPIToken ¶
func (_m *MockService) ResetAPIToken(ctx context.Context, id int64) error
ResetAPIToken provides a mock function with given fields: ctx, id
func (*MockService) ResetPassword ¶
ResetPassword provides a mock function with given fields: ctx, id, newPassword
func (*MockService) SetEmailVerified ¶
func (_m *MockService) SetEmailVerified(ctx context.Context, id int64) error
SetEmailVerified provides a mock function with given fields: ctx, id
type MockService_CreateOwner_Call ¶
MockService_CreateOwner_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateOwner'
func (*MockService_CreateOwner_Call) Return ¶
func (_c *MockService_CreateOwner_Call) Return(_a0 User, _a1 error) *MockService_CreateOwner_Call
func (*MockService_CreateOwner_Call) Run ¶
func (_c *MockService_CreateOwner_Call) Run(run func(ctx context.Context, orgID int64, email string, password string)) *MockService_CreateOwner_Call
func (*MockService_CreateOwner_Call) RunAndReturn ¶
func (_c *MockService_CreateOwner_Call) RunAndReturn(run func(context.Context, int64, string, string) (User, error)) *MockService_CreateOwner_Call
type MockService_CreateUser_Call ¶
MockService_CreateUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateUser'
func (*MockService_CreateUser_Call) Return ¶
func (_c *MockService_CreateUser_Call) Return(_a0 User, _a1 error) *MockService_CreateUser_Call
func (*MockService_CreateUser_Call) Run ¶
func (_c *MockService_CreateUser_Call) Run(run func(ctx context.Context, orgID int64, email string, password string)) *MockService_CreateUser_Call
func (*MockService_CreateUser_Call) RunAndReturn ¶
func (_c *MockService_CreateUser_Call) RunAndReturn(run func(context.Context, int64, string, string) (User, error)) *MockService_CreateUser_Call
type MockService_DeleteUser_Call ¶
MockService_DeleteUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteUser'
func (*MockService_DeleteUser_Call) Return ¶
func (_c *MockService_DeleteUser_Call) Return(_a0 error) *MockService_DeleteUser_Call
func (*MockService_DeleteUser_Call) Run ¶
func (_c *MockService_DeleteUser_Call) Run(run func(ctx context.Context, id int64, comment string)) *MockService_DeleteUser_Call
func (*MockService_DeleteUser_Call) RunAndReturn ¶
func (_c *MockService_DeleteUser_Call) RunAndReturn(run func(context.Context, int64, string) error) *MockService_DeleteUser_Call
type MockService_DisableUser_Call ¶
MockService_DisableUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DisableUser'
func (*MockService_DisableUser_Call) Return ¶
func (_c *MockService_DisableUser_Call) Return(_a0 error) *MockService_DisableUser_Call
func (*MockService_DisableUser_Call) Run ¶
func (_c *MockService_DisableUser_Call) Run(run func(ctx context.Context, id int64, comment string)) *MockService_DisableUser_Call
func (*MockService_DisableUser_Call) RunAndReturn ¶
func (_c *MockService_DisableUser_Call) RunAndReturn(run func(context.Context, int64, string) error) *MockService_DisableUser_Call
type MockService_EnableUser_Call ¶
MockService_EnableUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnableUser'
func (*MockService_EnableUser_Call) Return ¶
func (_c *MockService_EnableUser_Call) Return(_a0 error) *MockService_EnableUser_Call
func (*MockService_EnableUser_Call) Run ¶
func (_c *MockService_EnableUser_Call) Run(run func(ctx context.Context, id int64, comment string)) *MockService_EnableUser_Call
func (*MockService_EnableUser_Call) RunAndReturn ¶
func (_c *MockService_EnableUser_Call) RunAndReturn(run func(context.Context, int64, string) error) *MockService_EnableUser_Call
type MockService_Expecter ¶
type MockService_Expecter struct {
// contains filtered or unexported fields
}
func (*MockService_Expecter) CreateOwner ¶
func (_e *MockService_Expecter) CreateOwner(ctx interface{}, orgID interface{}, email interface{}, password interface{}) *MockService_CreateOwner_Call
CreateOwner is a helper method to define mock.On call
- ctx context.Context
- orgID int64
- email string
- password string
func (*MockService_Expecter) CreateUser ¶
func (_e *MockService_Expecter) CreateUser(ctx interface{}, orgID interface{}, email interface{}, password interface{}) *MockService_CreateUser_Call
CreateUser is a helper method to define mock.On call
- ctx context.Context
- orgID int64
- email string
- password string
func (*MockService_Expecter) DeleteUser ¶
func (_e *MockService_Expecter) DeleteUser(ctx interface{}, id interface{}, comment interface{}) *MockService_DeleteUser_Call
DeleteUser is a helper method to define mock.On call
- ctx context.Context
- id int64
- comment string
func (*MockService_Expecter) DisableUser ¶
func (_e *MockService_Expecter) DisableUser(ctx interface{}, id interface{}, comment interface{}) *MockService_DisableUser_Call
DisableUser is a helper method to define mock.On call
- ctx context.Context
- id int64
- comment string
func (*MockService_Expecter) EnableUser ¶
func (_e *MockService_Expecter) EnableUser(ctx interface{}, id interface{}, comment interface{}) *MockService_EnableUser_Call
EnableUser is a helper method to define mock.On call
- ctx context.Context
- id int64
- comment string
func (*MockService_Expecter) GenerateAPIToken ¶
func (_e *MockService_Expecter) GenerateAPIToken(ctx interface{}, id interface{}) *MockService_GenerateAPIToken_Call
GenerateAPIToken is a helper method to define mock.On call
- ctx context.Context
- id int64
func (*MockService_Expecter) GetUserByAPIToken ¶
func (_e *MockService_Expecter) GetUserByAPIToken(ctx interface{}, apiToken interface{}) *MockService_GetUserByAPIToken_Call
GetUserByAPIToken is a helper method to define mock.On call
- ctx context.Context
- apiToken string
func (*MockService_Expecter) GetUserByID ¶
func (_e *MockService_Expecter) GetUserByID(ctx interface{}, id interface{}) *MockService_GetUserByID_Call
GetUserByID is a helper method to define mock.On call
- ctx context.Context
- id int64
func (*MockService_Expecter) GetUserByOrgIDEmail ¶
func (_e *MockService_Expecter) GetUserByOrgIDEmail(ctx interface{}, orgID interface{}, email interface{}) *MockService_GetUserByOrgIDEmail_Call
GetUserByOrgIDEmail is a helper method to define mock.On call
- ctx context.Context
- orgID int64
- email string
func (*MockService_Expecter) GetUserByOrgSubdomainAPIToken ¶
func (_e *MockService_Expecter) GetUserByOrgSubdomainAPIToken(ctx interface{}, orgSubdomain interface{}, apiToken interface{}) *MockService_GetUserByOrgSubdomainAPIToken_Call
GetUserByOrgSubdomainAPIToken is a helper method to define mock.On call
- ctx context.Context
- orgSubdomain string
- apiToken string
func (*MockService_Expecter) GetUserByOrgSubdomainEmail ¶
func (_e *MockService_Expecter) GetUserByOrgSubdomainEmail(ctx interface{}, orgSubdomain interface{}, email interface{}) *MockService_GetUserByOrgSubdomainEmail_Call
GetUserByOrgSubdomainEmail is a helper method to define mock.On call
- ctx context.Context
- orgSubdomain string
- email string
func (*MockService_Expecter) ResetAPIToken ¶
func (_e *MockService_Expecter) ResetAPIToken(ctx interface{}, id interface{}) *MockService_ResetAPIToken_Call
ResetAPIToken is a helper method to define mock.On call
- ctx context.Context
- id int64
func (*MockService_Expecter) ResetPassword ¶
func (_e *MockService_Expecter) ResetPassword(ctx interface{}, id interface{}, newPassword interface{}) *MockService_ResetPassword_Call
ResetPassword is a helper method to define mock.On call
- ctx context.Context
- id int64
- newPassword string
func (*MockService_Expecter) SetEmailVerified ¶
func (_e *MockService_Expecter) SetEmailVerified(ctx interface{}, id interface{}) *MockService_SetEmailVerified_Call
SetEmailVerified is a helper method to define mock.On call
- ctx context.Context
- id int64
type MockService_GenerateAPIToken_Call ¶
MockService_GenerateAPIToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GenerateAPIToken'
func (*MockService_GenerateAPIToken_Call) Return ¶
func (_c *MockService_GenerateAPIToken_Call) Return(_a0 error) *MockService_GenerateAPIToken_Call
func (*MockService_GenerateAPIToken_Call) Run ¶
func (_c *MockService_GenerateAPIToken_Call) Run(run func(ctx context.Context, id int64)) *MockService_GenerateAPIToken_Call
func (*MockService_GenerateAPIToken_Call) RunAndReturn ¶
func (_c *MockService_GenerateAPIToken_Call) RunAndReturn(run func(context.Context, int64) error) *MockService_GenerateAPIToken_Call
type MockService_GetUserByAPIToken_Call ¶
MockService_GetUserByAPIToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUserByAPIToken'
func (*MockService_GetUserByAPIToken_Call) Return ¶
func (_c *MockService_GetUserByAPIToken_Call) Return(_a0 User, _a1 error) *MockService_GetUserByAPIToken_Call
func (*MockService_GetUserByAPIToken_Call) Run ¶
func (_c *MockService_GetUserByAPIToken_Call) Run(run func(ctx context.Context, apiToken string)) *MockService_GetUserByAPIToken_Call
func (*MockService_GetUserByAPIToken_Call) RunAndReturn ¶
func (_c *MockService_GetUserByAPIToken_Call) RunAndReturn(run func(context.Context, string) (User, error)) *MockService_GetUserByAPIToken_Call
type MockService_GetUserByID_Call ¶
MockService_GetUserByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUserByID'
func (*MockService_GetUserByID_Call) Return ¶
func (_c *MockService_GetUserByID_Call) Return(_a0 User, _a1 error) *MockService_GetUserByID_Call
func (*MockService_GetUserByID_Call) Run ¶
func (_c *MockService_GetUserByID_Call) Run(run func(ctx context.Context, id int64)) *MockService_GetUserByID_Call
func (*MockService_GetUserByID_Call) RunAndReturn ¶
func (_c *MockService_GetUserByID_Call) RunAndReturn(run func(context.Context, int64) (User, error)) *MockService_GetUserByID_Call
type MockService_GetUserByOrgIDEmail_Call ¶
MockService_GetUserByOrgIDEmail_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUserByOrgIDEmail'
func (*MockService_GetUserByOrgIDEmail_Call) Return ¶
func (_c *MockService_GetUserByOrgIDEmail_Call) Return(_a0 User, _a1 error) *MockService_GetUserByOrgIDEmail_Call
func (*MockService_GetUserByOrgIDEmail_Call) Run ¶
func (_c *MockService_GetUserByOrgIDEmail_Call) Run(run func(ctx context.Context, orgID int64, email string)) *MockService_GetUserByOrgIDEmail_Call
func (*MockService_GetUserByOrgIDEmail_Call) RunAndReturn ¶
func (_c *MockService_GetUserByOrgIDEmail_Call) RunAndReturn(run func(context.Context, int64, string) (User, error)) *MockService_GetUserByOrgIDEmail_Call
type MockService_GetUserByOrgSubdomainAPIToken_Call ¶
MockService_GetUserByOrgSubdomainAPIToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUserByOrgSubdomainAPIToken'
func (*MockService_GetUserByOrgSubdomainAPIToken_Call) Return ¶
func (_c *MockService_GetUserByOrgSubdomainAPIToken_Call) Return(_a0 User, _a1 error) *MockService_GetUserByOrgSubdomainAPIToken_Call
func (*MockService_GetUserByOrgSubdomainAPIToken_Call) Run ¶
func (_c *MockService_GetUserByOrgSubdomainAPIToken_Call) Run(run func(ctx context.Context, orgSubdomain string, apiToken string)) *MockService_GetUserByOrgSubdomainAPIToken_Call
func (*MockService_GetUserByOrgSubdomainAPIToken_Call) RunAndReturn ¶
func (_c *MockService_GetUserByOrgSubdomainAPIToken_Call) RunAndReturn(run func(context.Context, string, string) (User, error)) *MockService_GetUserByOrgSubdomainAPIToken_Call
type MockService_GetUserByOrgSubdomainEmail_Call ¶
MockService_GetUserByOrgSubdomainEmail_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUserByOrgSubdomainEmail'
func (*MockService_GetUserByOrgSubdomainEmail_Call) Return ¶
func (_c *MockService_GetUserByOrgSubdomainEmail_Call) Return(_a0 User, _a1 error) *MockService_GetUserByOrgSubdomainEmail_Call
func (*MockService_GetUserByOrgSubdomainEmail_Call) Run ¶
func (_c *MockService_GetUserByOrgSubdomainEmail_Call) Run(run func(ctx context.Context, orgSubdomain string, email string)) *MockService_GetUserByOrgSubdomainEmail_Call
func (*MockService_GetUserByOrgSubdomainEmail_Call) RunAndReturn ¶
func (_c *MockService_GetUserByOrgSubdomainEmail_Call) RunAndReturn(run func(context.Context, string, string) (User, error)) *MockService_GetUserByOrgSubdomainEmail_Call
type MockService_ResetAPIToken_Call ¶
MockService_ResetAPIToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ResetAPIToken'
func (*MockService_ResetAPIToken_Call) Return ¶
func (_c *MockService_ResetAPIToken_Call) Return(_a0 error) *MockService_ResetAPIToken_Call
func (*MockService_ResetAPIToken_Call) Run ¶
func (_c *MockService_ResetAPIToken_Call) Run(run func(ctx context.Context, id int64)) *MockService_ResetAPIToken_Call
func (*MockService_ResetAPIToken_Call) RunAndReturn ¶
func (_c *MockService_ResetAPIToken_Call) RunAndReturn(run func(context.Context, int64) error) *MockService_ResetAPIToken_Call
type MockService_ResetPassword_Call ¶
MockService_ResetPassword_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ResetPassword'
func (*MockService_ResetPassword_Call) Return ¶
func (_c *MockService_ResetPassword_Call) Return(_a0 error) *MockService_ResetPassword_Call
func (*MockService_ResetPassword_Call) Run ¶
func (_c *MockService_ResetPassword_Call) Run(run func(ctx context.Context, id int64, newPassword string)) *MockService_ResetPassword_Call
func (*MockService_ResetPassword_Call) RunAndReturn ¶
func (_c *MockService_ResetPassword_Call) RunAndReturn(run func(context.Context, int64, string) error) *MockService_ResetPassword_Call
type MockService_SetEmailVerified_Call ¶
MockService_SetEmailVerified_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetEmailVerified'
func (*MockService_SetEmailVerified_Call) Return ¶
func (_c *MockService_SetEmailVerified_Call) Return(_a0 error) *MockService_SetEmailVerified_Call
func (*MockService_SetEmailVerified_Call) Run ¶
func (_c *MockService_SetEmailVerified_Call) Run(run func(ctx context.Context, id int64)) *MockService_SetEmailVerified_Call
func (*MockService_SetEmailVerified_Call) RunAndReturn ¶
func (_c *MockService_SetEmailVerified_Call) RunAndReturn(run func(context.Context, int64) error) *MockService_SetEmailVerified_Call
type Repository ¶
type Repository interface { // GetUserByID returns a user by its ID. GetUserByID(ctx context.Context, id int64) (User, error) // GetUserByAPIToken returns a user by its API token. GetUserByAPIToken(ctx context.Context, apiToken string) (User, error) // GetUserByOrgSubdomainAPIToken returns a user of organization by its org subdomain and api token. GetUserByOrgSubdomainAPIToken(ctx context.Context, orgSubdomain, apiToken string) (User, error) // GetUserByOrgIDEmail returns a user of organization by its org id and email. GetUserByOrgIDEmail(ctx context.Context, orgID int64, email string) (User, error) // GetUserByOrgSubdomainEmail returns a user of organization by its org subdomain and email. GetUserByOrgSubdomainEmail(ctx context.Context, orgSubdomain, email string) (User, error) // CreateUser creates a new user. CreateUser(ctx context.Context, orgID int64, email, passwordHash string, isOwner bool) (User, error) // ResetPassword resets the password of a user. ResetPassword(ctx context.Context, id int64, passwordHash string) error // DeleteUser deletes a user by its ID. DeleteUser(ctx context.Context, id int64, comment string) error // DisableUser disables a user by its ID. DisableUser(ctx context.Context, id int64, comment string) error // EnableUser enables a user by its ID. EnableUser(ctx context.Context, id int64, comment string) error // GenerateAPIToken generates a new API token for a user. GenerateAPIToken(ctx context.Context, id int64) error // ResetAPIToken resets the API token of a user. ResetAPIToken(ctx context.Context, id int64) error // SetEmailVerified sets the email_verified flag of a user. SetEmailVerified(ctx context.Context, id int64) error }
Repository is a repository for managing users in the database.
func NewRepository ¶
func NewRepository(db database.Database) Repository
type Service ¶
type Service interface { // GetUserByID returns a user by its ID. GetUserByID(ctx context.Context, id int64) (User, error) // GetUserByAPIToken returns a user by its API token. GetUserByAPIToken(ctx context.Context, apiToken string) (User, error) // GetUserByOrgSubdomainAPIToken returns a user of organization by its org subdomain and api token. GetUserByOrgSubdomainAPIToken(ctx context.Context, orgSubdomain, apiToken string) (User, error) // GetUserByOrgIDEmail returns a user of organization by its org id and email. GetUserByOrgIDEmail(ctx context.Context, orgID int64, email string) (User, error) // GetUserByOrgSubdomainEmail returns a user of organization by its org subdomain and email. GetUserByOrgSubdomainEmail(ctx context.Context, orgSubdomain, email string) (User, error) // CreateUser creates a new user. CreateUser(ctx context.Context, orgID int64, email, password string) (User, error) // CreateOwner creates a new owner user. CreateOwner(ctx context.Context, orgID int64, email, password string) (User, error) // ResetPassword resets the password of a user. ResetPassword(ctx context.Context, id int64, newPassword string) error // DeleteUser deletes a user by its ID. // This also deletes the user session. DeleteUser(ctx context.Context, id int64, comment string) error // DisableUser disables a user by its ID. // This also deletes the user session. DisableUser(ctx context.Context, id int64, comment string) error // EnableUser enables a user by its ID. EnableUser(ctx context.Context, id int64, comment string) error // GenerateAPIToken generates a new API token for a user. GenerateAPIToken(ctx context.Context, id int64) error // ResetAPIToken resets the API token of a user. ResetAPIToken(ctx context.Context, id int64) error // SetEmailVerified sets the email_verified flag of a user. SetEmailVerified(ctx context.Context, id int64) error }
Service is a service for managing users.
type User ¶
type User struct { // ID is the unique identifier of the user. ID int64 `db:"user_id"` // OrganizationID is the reference to the organization the user belongs to. OrganizationID int64 `db:"organization_id"` // Email is the email address of the user. Email string `db:"email"` // PasswordHash is the hashed password of the user. PasswordHash string `db:"password_hash"` // APIToken is the token used to authenticate the user for API requests. APIToken *string `db:"api_token"` // IsOwner represents whether the user is the owner of the organization. IsOwner bool `db:"is_owner"` // IsEmailVerified represents whether the user's email is verified. IsEmailVerified bool `db:"is_email_verified"` // DisabledAt is the timestamp when the user was disabled. DisabledAt *time.Time `db:"disabled_at"` // Comment represents any additional information about the user's current state. Comment *string `db:"comment"` base.Timestamps }
User represents a user.