Documentation
¶
Index ¶
- type AuthLogin
- type AuthLogout
- type AuthRefresh
- type AuthService
- func (s AuthService) Account(ctx context.Context) (*model.User, error)
- func (s AuthService) Login(ctx context.Context, input AuthLogin) (*model.AuthToken, error)
- func (s AuthService) Logout(ctx context.Context, input AuthLogout) error
- func (s AuthService) Refresh(ctx context.Context, input AuthRefresh) (*model.AuthToken, error)
- func (s AuthService) Trx(db *gorm.DB) IAuthService
- type IAuthService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthLogout ¶
type AuthLogout struct {
Token string
}
type AuthRefresh ¶
type AuthService ¶
type AuthService struct {
// contains filtered or unexported fields
}
func NewAuthService ¶
func NewAuthService( userRepository repository.IUserRepository, tokenRepository repository.ITokenRepository, tokenCache cache.ITokenCache, userCache cache.IUserCache, hasher secret.Hasher, accessExpire time.Duration, refreshExpire time.Duration, accessSecret string, ) AuthService
func (AuthService) Logout ¶
func (s AuthService) Logout(ctx context.Context, input AuthLogout) error
func (AuthService) Refresh ¶
func (s AuthService) Refresh(ctx context.Context, input AuthRefresh) (*model.AuthToken, error)
func (AuthService) Trx ¶
func (s AuthService) Trx(db *gorm.DB) IAuthService
type IAuthService ¶
type IAuthService interface {
Trx(db *gorm.DB) IAuthService
Login(ctx context.Context, input AuthLogin) (*model.AuthToken, error)
Refresh(ctx context.Context, input AuthRefresh) (*model.AuthToken, error)
Logout(ctx context.Context, input AuthLogout) error
Account(ctx context.Context) (*model.User, error)
}
Click to show internal directories.
Click to hide internal directories.