Documentation
¶
Index ¶
- type AuthMiddleware
- func (_m *AuthMiddleware) APIKey() gin.HandlerFunc
- func (_m *AuthMiddleware) JWT() gin.HandlerFunc
- func (_m *AuthMiddleware) Optional() gin.HandlerFunc
- func (_m *AuthMiddleware) RequireAuth() gin.HandlerFunc
- func (_m *AuthMiddleware) RequirePermission(resource string, action string) gin.HandlerFunc
- func (_m *AuthMiddleware) RequireRole(role string) gin.HandlerFunc
- type GoogleSignin
- type SocialAccount
- type SocialAccountRepository
- func (_m *SocialAccountRepository) Create(ctx context.Context, data *models.SocialAccount) (*models.SocialAccount, error)
- func (_m *SocialAccountRepository) DeleteByUserID(ctx context.Context, userID string) error
- func (_m *SocialAccountRepository) FindByProvider(ctx context.Context, provider types.AuthProvider, providerUserID string) (*models.SocialAccount, error)
- func (_m *SocialAccountRepository) FindByUserID(ctx context.Context, userID string) (*models.SocialAccount, error)
- type TokenIssuer
- func (_m *TokenIssuer) IssueToken(user interfaces.User) (*responses.TokenResponse, error)
- func (_m *TokenIssuer) RefreshToken(refreshToken string) (*responses.TokenResponse, error)
- func (_m *TokenIssuer) RevokeToken(token string) error
- func (_m *TokenIssuer) ValidateToken(token string) (map[string]interface{}, error)
- type User
- func (_m *User) GetEmail() string
- func (_m *User) GetEmailVerified() bool
- func (_m *User) GetEmailVerifiedAt() *types.DateTime
- func (_m *User) GetID() uuid.UUID
- func (_m *User) GetLastLoginAt() *time.Time
- func (_m *User) GetMetadata() map[string]interface{}
- func (_m *User) GetPasswordHash() string
- func (_m *User) GetPasswordResetAt() *time.Time
- func (_m *User) GetPasswordResetToken() *string
- func (_m *User) GetPhoneNumber() string
- func (_m *User) GetRole() string
- func (_m *User) GetUsername() string
- func (_m *User) IsActive() bool
- func (_m *User) SetPassword(password string)
- func (_m *User) SetPasswordResetAt(at *time.Time)
- func (_m *User) SetPasswordResetToken(token *string)
- type UserRepository
- func (_m *UserRepository) ChangePassword(ctx context.Context, user interfaces.User, newPasswordHash string) error
- func (_m *UserRepository) Create(ctx context.Context, data map[string]interface{}) (interfaces.User, error)
- func (_m *UserRepository) FindByEmail(ctx context.Context, email string) (interfaces.User, error)
- func (_m *UserRepository) FindByID(ctx context.Context, id uuid.UUID) (interfaces.User, error)
- func (_m *UserRepository) FindByIdentifier(ctx context.Context, identifier string) (interfaces.User, error)
- func (_m *UserRepository) FindByPhoneNumber(ctx context.Context, phone string) (interfaces.User, error)
- func (_m *UserRepository) FindByResetToken(ctx context.Context, token string) (interfaces.User, error)
- func (_m *UserRepository) FindByUsername(ctx context.Context, username string) (interfaces.User, error)
- func (_m *UserRepository) Update(ctx context.Context, user interfaces.User, updates map[string]interface{}) error
- func (_m *UserRepository) UpdateLastLogin(ctx context.Context, user interfaces.User) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthMiddleware ¶
AuthMiddleware is an autogenerated mock type for the AuthMiddleware type
func NewAuthMiddleware ¶
func NewAuthMiddleware(t interface {
mock.TestingT
Cleanup(func())
}) *AuthMiddleware
NewAuthMiddleware creates a new instance of AuthMiddleware. 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 (*AuthMiddleware) APIKey ¶
func (_m *AuthMiddleware) APIKey() gin.HandlerFunc
APIKey provides a mock function with no fields
func (*AuthMiddleware) JWT ¶
func (_m *AuthMiddleware) JWT() gin.HandlerFunc
JWT provides a mock function with no fields
func (*AuthMiddleware) Optional ¶
func (_m *AuthMiddleware) Optional() gin.HandlerFunc
Optional provides a mock function with no fields
func (*AuthMiddleware) RequireAuth ¶
func (_m *AuthMiddleware) RequireAuth() gin.HandlerFunc
RequireAuth provides a mock function with no fields
func (*AuthMiddleware) RequirePermission ¶
func (_m *AuthMiddleware) RequirePermission(resource string, action string) gin.HandlerFunc
RequirePermission provides a mock function with given fields: resource, action
func (*AuthMiddleware) RequireRole ¶
func (_m *AuthMiddleware) RequireRole(role string) gin.HandlerFunc
RequireRole provides a mock function with given fields: role
type GoogleSignin ¶
GoogleSignin is an autogenerated mock type for the GoogleSignin type
func NewGoogleSignin ¶
func NewGoogleSignin(t interface {
mock.TestingT
Cleanup(func())
}) *GoogleSignin
NewGoogleSignin creates a new instance of GoogleSignin. 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 (*GoogleSignin) Exchange ¶
func (_m *GoogleSignin) Exchange(ctx context.Context, code string) (*pkg.GoogleUser, error)
Exchange provides a mock function with given fields: ctx, code
func (*GoogleSignin) GetAuthURL ¶
func (_m *GoogleSignin) GetAuthURL(state string) string
GetAuthURL provides a mock function with given fields: state
func (*GoogleSignin) VerifyGoogleIDToken ¶
func (_m *GoogleSignin) VerifyGoogleIDToken(ctx context.Context, tokenString string) (*pkg.GoogleUser, error)
VerifyGoogleIDToken provides a mock function with given fields: ctx, tokenString
type SocialAccount ¶
SocialAccount is an autogenerated mock type for the SocialAccount type
func NewSocialAccount ¶
func NewSocialAccount(t interface {
mock.TestingT
Cleanup(func())
}) *SocialAccount
NewSocialAccount creates a new instance of SocialAccount. 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 (*SocialAccount) GetID ¶
func (_m *SocialAccount) GetID() string
GetID provides a mock function with no fields
func (*SocialAccount) GetMetadata ¶
func (_m *SocialAccount) GetMetadata() map[string]interface{}
GetMetadata provides a mock function with no fields
func (*SocialAccount) GetProvider ¶
func (_m *SocialAccount) GetProvider() string
GetProvider provides a mock function with no fields
func (*SocialAccount) GetProviderUserID ¶
func (_m *SocialAccount) GetProviderUserID() string
GetProviderUserID provides a mock function with no fields
func (*SocialAccount) GetUser ¶
func (_m *SocialAccount) GetUser() interfaces.User
GetUser provides a mock function with no fields
func (*SocialAccount) GetUserID ¶
func (_m *SocialAccount) GetUserID() string
GetUserID provides a mock function with no fields
type SocialAccountRepository ¶
SocialAccountRepository is an autogenerated mock type for the SocialAccountRepository type
func NewSocialAccountRepository ¶
func NewSocialAccountRepository(t interface {
mock.TestingT
Cleanup(func())
}) *SocialAccountRepository
NewSocialAccountRepository creates a new instance of SocialAccountRepository. 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 (*SocialAccountRepository) Create ¶
func (_m *SocialAccountRepository) Create(ctx context.Context, data *models.SocialAccount) (*models.SocialAccount, error)
Create provides a mock function with given fields: ctx, data
func (*SocialAccountRepository) DeleteByUserID ¶
func (_m *SocialAccountRepository) DeleteByUserID(ctx context.Context, userID string) error
DeleteByUserID provides a mock function with given fields: ctx, userID
func (*SocialAccountRepository) FindByProvider ¶
func (_m *SocialAccountRepository) FindByProvider(ctx context.Context, provider types.AuthProvider, providerUserID string) (*models.SocialAccount, error)
FindByProvider provides a mock function with given fields: ctx, provider, providerUserID
func (*SocialAccountRepository) FindByUserID ¶
func (_m *SocialAccountRepository) FindByUserID(ctx context.Context, userID string) (*models.SocialAccount, error)
FindByUserID provides a mock function with given fields: ctx, userID
type TokenIssuer ¶
TokenIssuer is an autogenerated mock type for the TokenIssuer type
func NewTokenIssuer ¶
func NewTokenIssuer(t interface {
mock.TestingT
Cleanup(func())
}) *TokenIssuer
NewTokenIssuer creates a new instance of TokenIssuer. 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 (*TokenIssuer) IssueToken ¶
func (_m *TokenIssuer) IssueToken(user interfaces.User) (*responses.TokenResponse, error)
IssueToken provides a mock function with given fields: user
func (*TokenIssuer) RefreshToken ¶
func (_m *TokenIssuer) RefreshToken(refreshToken string) (*responses.TokenResponse, error)
RefreshToken provides a mock function with given fields: refreshToken
func (*TokenIssuer) RevokeToken ¶
func (_m *TokenIssuer) RevokeToken(token string) error
RevokeToken provides a mock function with given fields: token
func (*TokenIssuer) ValidateToken ¶
func (_m *TokenIssuer) ValidateToken(token string) (map[string]interface{}, error)
ValidateToken provides a mock function with given fields: token
type User ¶
User is an autogenerated mock type for the User type
func NewUser ¶
NewUser creates a new instance of User. 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 (*User) GetEmailVerified ¶
GetEmailVerified provides a mock function with no fields
func (*User) GetEmailVerifiedAt ¶
GetEmailVerifiedAt provides a mock function with no fields
func (*User) GetLastLoginAt ¶
GetLastLoginAt provides a mock function with no fields
func (*User) GetMetadata ¶
GetMetadata provides a mock function with no fields
func (*User) GetPasswordHash ¶
GetPasswordHash provides a mock function with no fields
func (*User) GetPasswordResetAt ¶
GetPasswordResetAt provides a mock function with no fields
func (*User) GetPasswordResetToken ¶
GetPasswordResetToken provides a mock function with no fields
func (*User) GetPhoneNumber ¶
GetPhoneNumber provides a mock function with no fields
func (*User) GetUsername ¶
GetUsername provides a mock function with no fields
func (*User) SetPassword ¶
SetPassword provides a mock function with given fields: password
func (*User) SetPasswordResetAt ¶
SetPasswordResetAt provides a mock function with given fields: at
func (*User) SetPasswordResetToken ¶
SetPasswordResetToken provides a mock function with given fields: token
type UserRepository ¶
UserRepository is an autogenerated mock type for the UserRepository type
func NewUserRepository ¶
func NewUserRepository(t interface {
mock.TestingT
Cleanup(func())
}) *UserRepository
NewUserRepository creates a new instance of UserRepository. 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 (*UserRepository) ChangePassword ¶
func (_m *UserRepository) ChangePassword(ctx context.Context, user interfaces.User, newPasswordHash string) error
ChangePassword provides a mock function with given fields: ctx, user, newPasswordHash
func (*UserRepository) Create ¶
func (_m *UserRepository) Create(ctx context.Context, data map[string]interface{}) (interfaces.User, error)
Create provides a mock function with given fields: ctx, data
func (*UserRepository) FindByEmail ¶
func (_m *UserRepository) FindByEmail(ctx context.Context, email string) (interfaces.User, error)
FindByEmail provides a mock function with given fields: ctx, email
func (*UserRepository) FindByID ¶
func (_m *UserRepository) FindByID(ctx context.Context, id uuid.UUID) (interfaces.User, error)
FindByID provides a mock function with given fields: ctx, id
func (*UserRepository) FindByIdentifier ¶
func (_m *UserRepository) FindByIdentifier(ctx context.Context, identifier string) (interfaces.User, error)
FindByIdentifier provides a mock function with given fields: ctx, identifier
func (*UserRepository) FindByPhoneNumber ¶
func (_m *UserRepository) FindByPhoneNumber(ctx context.Context, phone string) (interfaces.User, error)
FindByPhoneNumber provides a mock function with given fields: ctx, phone
func (*UserRepository) FindByResetToken ¶
func (_m *UserRepository) FindByResetToken(ctx context.Context, token string) (interfaces.User, error)
FindByResetToken provides a mock function with given fields: ctx, token
func (*UserRepository) FindByUsername ¶
func (_m *UserRepository) FindByUsername(ctx context.Context, username string) (interfaces.User, error)
FindByUsername provides a mock function with given fields: ctx, username
func (*UserRepository) Update ¶
func (_m *UserRepository) Update(ctx context.Context, user interfaces.User, updates map[string]interface{}) error
Update provides a mock function with given fields: ctx, user, updates
func (*UserRepository) UpdateLastLogin ¶
func (_m *UserRepository) UpdateLastLogin(ctx context.Context, user interfaces.User) error
UpdateLastLogin provides a mock function with given fields: ctx, user