Documentation ¶
Index ¶
- type AuthUseCase
- type MockAuthUseCase
- func (_m *MockAuthUseCase) EXPECT() *MockAuthUseCase_Expecter
- func (_m *MockAuthUseCase) ParseToken(tokenString string, tokenPublicKey string) (*jwt.MapClaims, error)
- func (_m *MockAuthUseCase) RefreshToken(userId uuid.UUID, userRefreshToken string) (*Tokens, error)
- func (_m *MockAuthUseCase) SignIn(payload SignInRequest) (*Tokens, error)
- func (_m *MockAuthUseCase) SignOut(userId uuid.UUID) (*models.User, error)
- func (_m *MockAuthUseCase) SignUp(payload SignUpRequest) (*models.User, error)
- type MockAuthUseCase_Expecter
- func (_e *MockAuthUseCase_Expecter) ParseToken(tokenString interface{}, tokenPublicKey interface{}) *MockAuthUseCase_ParseToken_Call
- func (_e *MockAuthUseCase_Expecter) RefreshToken(userId interface{}, userRefreshToken interface{}) *MockAuthUseCase_RefreshToken_Call
- func (_e *MockAuthUseCase_Expecter) SignIn(payload interface{}) *MockAuthUseCase_SignIn_Call
- func (_e *MockAuthUseCase_Expecter) SignOut(userId interface{}) *MockAuthUseCase_SignOut_Call
- func (_e *MockAuthUseCase_Expecter) SignUp(payload interface{}) *MockAuthUseCase_SignUp_Call
- type MockAuthUseCase_ParseToken_Call
- func (_c *MockAuthUseCase_ParseToken_Call) Return(_a0 *jwt.MapClaims, _a1 error) *MockAuthUseCase_ParseToken_Call
- func (_c *MockAuthUseCase_ParseToken_Call) Run(run func(tokenString string, tokenPublicKey string)) *MockAuthUseCase_ParseToken_Call
- func (_c *MockAuthUseCase_ParseToken_Call) RunAndReturn(run func(string, string) (*jwt.MapClaims, error)) *MockAuthUseCase_ParseToken_Call
- type MockAuthUseCase_RefreshToken_Call
- func (_c *MockAuthUseCase_RefreshToken_Call) Return(_a0 *Tokens, _a1 error) *MockAuthUseCase_RefreshToken_Call
- func (_c *MockAuthUseCase_RefreshToken_Call) Run(run func(userId uuid.UUID, userRefreshToken string)) *MockAuthUseCase_RefreshToken_Call
- func (_c *MockAuthUseCase_RefreshToken_Call) RunAndReturn(run func(uuid.UUID, string) (*Tokens, error)) *MockAuthUseCase_RefreshToken_Call
- type MockAuthUseCase_SignIn_Call
- func (_c *MockAuthUseCase_SignIn_Call) Return(_a0 *Tokens, _a1 error) *MockAuthUseCase_SignIn_Call
- func (_c *MockAuthUseCase_SignIn_Call) Run(run func(payload SignInRequest)) *MockAuthUseCase_SignIn_Call
- func (_c *MockAuthUseCase_SignIn_Call) RunAndReturn(run func(SignInRequest) (*Tokens, error)) *MockAuthUseCase_SignIn_Call
- type MockAuthUseCase_SignOut_Call
- func (_c *MockAuthUseCase_SignOut_Call) Return(_a0 *models.User, _a1 error) *MockAuthUseCase_SignOut_Call
- func (_c *MockAuthUseCase_SignOut_Call) Run(run func(userId uuid.UUID)) *MockAuthUseCase_SignOut_Call
- func (_c *MockAuthUseCase_SignOut_Call) RunAndReturn(run func(uuid.UUID) (*models.User, error)) *MockAuthUseCase_SignOut_Call
- type MockAuthUseCase_SignUp_Call
- func (_c *MockAuthUseCase_SignUp_Call) Return(_a0 *models.User, _a1 error) *MockAuthUseCase_SignUp_Call
- func (_c *MockAuthUseCase_SignUp_Call) Run(run func(payload SignUpRequest)) *MockAuthUseCase_SignUp_Call
- func (_c *MockAuthUseCase_SignUp_Call) RunAndReturn(run func(SignUpRequest) (*models.User, error)) *MockAuthUseCase_SignUp_Call
- type SignInRequest
- type SignUpRequest
- type Tokens
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthUseCase ¶
type AuthUseCase interface { SignUp(payload SignUpRequest) (*models.User, error) SignIn(payload SignInRequest) (*Tokens, error) SignOut(userId uuid.UUID) (*models.User, error) RefreshToken(userId uuid.UUID, userRefreshToken string) (*Tokens, error) ParseToken(tokenString, tokenPublicKey string) (*jwt.MapClaims, error) }
func NewAuthUseCase ¶
func NewAuthUseCase(repo repository.UserRepository, conf *config.Config) AuthUseCase
type MockAuthUseCase ¶
MockAuthUseCase is an autogenerated mock type for the AuthUseCase type
func NewMockAuthUseCase ¶
func NewMockAuthUseCase(t interface { mock.TestingT Cleanup(func()) }) *MockAuthUseCase
NewMockAuthUseCase creates a new instance of MockAuthUseCase. 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 (*MockAuthUseCase) EXPECT ¶
func (_m *MockAuthUseCase) EXPECT() *MockAuthUseCase_Expecter
func (*MockAuthUseCase) ParseToken ¶
func (_m *MockAuthUseCase) ParseToken(tokenString string, tokenPublicKey string) (*jwt.MapClaims, error)
ParseToken provides a mock function with given fields: tokenString, tokenPublicKey
func (*MockAuthUseCase) RefreshToken ¶
RefreshToken provides a mock function with given fields: userId, userRefreshToken
func (*MockAuthUseCase) SignIn ¶
func (_m *MockAuthUseCase) SignIn(payload SignInRequest) (*Tokens, error)
SignIn provides a mock function with given fields: payload
func (*MockAuthUseCase) SignUp ¶
func (_m *MockAuthUseCase) SignUp(payload SignUpRequest) (*models.User, error)
SignUp provides a mock function with given fields: payload
type MockAuthUseCase_Expecter ¶
type MockAuthUseCase_Expecter struct {
// contains filtered or unexported fields
}
func (*MockAuthUseCase_Expecter) ParseToken ¶
func (_e *MockAuthUseCase_Expecter) ParseToken(tokenString interface{}, tokenPublicKey interface{}) *MockAuthUseCase_ParseToken_Call
ParseToken is a helper method to define mock.On call
- tokenString string
- tokenPublicKey string
func (*MockAuthUseCase_Expecter) RefreshToken ¶
func (_e *MockAuthUseCase_Expecter) RefreshToken(userId interface{}, userRefreshToken interface{}) *MockAuthUseCase_RefreshToken_Call
RefreshToken is a helper method to define mock.On call
- userId uuid.UUID
- userRefreshToken string
func (*MockAuthUseCase_Expecter) SignIn ¶
func (_e *MockAuthUseCase_Expecter) SignIn(payload interface{}) *MockAuthUseCase_SignIn_Call
SignIn is a helper method to define mock.On call
- payload SignInRequest
func (*MockAuthUseCase_Expecter) SignOut ¶
func (_e *MockAuthUseCase_Expecter) SignOut(userId interface{}) *MockAuthUseCase_SignOut_Call
SignOut is a helper method to define mock.On call
- userId uuid.UUID
func (*MockAuthUseCase_Expecter) SignUp ¶
func (_e *MockAuthUseCase_Expecter) SignUp(payload interface{}) *MockAuthUseCase_SignUp_Call
SignUp is a helper method to define mock.On call
- payload SignUpRequest
type MockAuthUseCase_ParseToken_Call ¶
MockAuthUseCase_ParseToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseToken'
func (*MockAuthUseCase_ParseToken_Call) Return ¶
func (_c *MockAuthUseCase_ParseToken_Call) Return(_a0 *jwt.MapClaims, _a1 error) *MockAuthUseCase_ParseToken_Call
func (*MockAuthUseCase_ParseToken_Call) Run ¶
func (_c *MockAuthUseCase_ParseToken_Call) Run(run func(tokenString string, tokenPublicKey string)) *MockAuthUseCase_ParseToken_Call
func (*MockAuthUseCase_ParseToken_Call) RunAndReturn ¶
func (_c *MockAuthUseCase_ParseToken_Call) RunAndReturn(run func(string, string) (*jwt.MapClaims, error)) *MockAuthUseCase_ParseToken_Call
type MockAuthUseCase_RefreshToken_Call ¶
MockAuthUseCase_RefreshToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RefreshToken'
func (*MockAuthUseCase_RefreshToken_Call) Return ¶
func (_c *MockAuthUseCase_RefreshToken_Call) Return(_a0 *Tokens, _a1 error) *MockAuthUseCase_RefreshToken_Call
func (*MockAuthUseCase_RefreshToken_Call) Run ¶
func (_c *MockAuthUseCase_RefreshToken_Call) Run(run func(userId uuid.UUID, userRefreshToken string)) *MockAuthUseCase_RefreshToken_Call
func (*MockAuthUseCase_RefreshToken_Call) RunAndReturn ¶
func (_c *MockAuthUseCase_RefreshToken_Call) RunAndReturn(run func(uuid.UUID, string) (*Tokens, error)) *MockAuthUseCase_RefreshToken_Call
type MockAuthUseCase_SignIn_Call ¶
MockAuthUseCase_SignIn_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SignIn'
func (*MockAuthUseCase_SignIn_Call) Return ¶
func (_c *MockAuthUseCase_SignIn_Call) Return(_a0 *Tokens, _a1 error) *MockAuthUseCase_SignIn_Call
func (*MockAuthUseCase_SignIn_Call) Run ¶
func (_c *MockAuthUseCase_SignIn_Call) Run(run func(payload SignInRequest)) *MockAuthUseCase_SignIn_Call
func (*MockAuthUseCase_SignIn_Call) RunAndReturn ¶
func (_c *MockAuthUseCase_SignIn_Call) RunAndReturn(run func(SignInRequest) (*Tokens, error)) *MockAuthUseCase_SignIn_Call
type MockAuthUseCase_SignOut_Call ¶
MockAuthUseCase_SignOut_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SignOut'
func (*MockAuthUseCase_SignOut_Call) Return ¶
func (_c *MockAuthUseCase_SignOut_Call) Return(_a0 *models.User, _a1 error) *MockAuthUseCase_SignOut_Call
func (*MockAuthUseCase_SignOut_Call) Run ¶
func (_c *MockAuthUseCase_SignOut_Call) Run(run func(userId uuid.UUID)) *MockAuthUseCase_SignOut_Call
func (*MockAuthUseCase_SignOut_Call) RunAndReturn ¶
func (_c *MockAuthUseCase_SignOut_Call) RunAndReturn(run func(uuid.UUID) (*models.User, error)) *MockAuthUseCase_SignOut_Call
type MockAuthUseCase_SignUp_Call ¶
MockAuthUseCase_SignUp_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SignUp'
func (*MockAuthUseCase_SignUp_Call) Return ¶
func (_c *MockAuthUseCase_SignUp_Call) Return(_a0 *models.User, _a1 error) *MockAuthUseCase_SignUp_Call
func (*MockAuthUseCase_SignUp_Call) Run ¶
func (_c *MockAuthUseCase_SignUp_Call) Run(run func(payload SignUpRequest)) *MockAuthUseCase_SignUp_Call
func (*MockAuthUseCase_SignUp_Call) RunAndReturn ¶
func (_c *MockAuthUseCase_SignUp_Call) RunAndReturn(run func(SignUpRequest) (*models.User, error)) *MockAuthUseCase_SignUp_Call