Documentation
¶
Index ¶
- func CompareHash(hashedPassword, password string) error
- func GenerateHash(password string) (string, error)
- type AuthInteractor
- type Cache
- type Interactor
- func (i *Interactor) Login(ctx context.Context, req user.LoginRequest) (user.LoginResponse, error)
- func (i *Interactor) Profile(ctx context.Context, req user.ProfileRequest) (user.ProfileResponse, error)
- func (i *Interactor) RefreshToken(ctx context.Context, req user.RefreshTokenRequest) (user.RefreshTokenResponse, error)
- func (i *Interactor) Register(ctx context.Context, req user.RegisterRequest) (user.RegisterResponse, error)
- type Repository
- type Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareHash ¶
func GenerateHash ¶
Types ¶
type AuthInteractor ¶
type AuthInteractor interface { CreateAccessToken(req entity.Authenticable) (string, error) CreateRefreshToken(req entity.Authenticable) (string, error) ParseToken(secret, requestToken string) (*authentication.Claims, error) }
type Interactor ¶
type Interactor struct {
// contains filtered or unexported fields
}
func New ¶
func New( cfg *configs.Config, trc contract.Tracer, authIntr AuthInteractor, vld Validator, cache Cache, repository Repository, ) *Interactor
func (*Interactor) Login ¶
func (i *Interactor) Login(ctx context.Context, req user.LoginRequest) (user.LoginResponse, error)
func (*Interactor) Profile ¶
func (i *Interactor) Profile(ctx context.Context, req user.ProfileRequest) (user.ProfileResponse, error)
func (*Interactor) RefreshToken ¶
func (i *Interactor) RefreshToken( ctx context.Context, req user.RefreshTokenRequest, ) (user.RefreshTokenResponse, error)
func (*Interactor) Register ¶
func (i *Interactor) Register(ctx context.Context, req user.RegisterRequest) (user.RegisterResponse, error)
type Repository ¶
type Validator ¶
type Validator interface { ValidateRegisterRequest(req user.RegisterRequest) (map[string]string, error) ValidateLoginRequest(req user.LoginRequest) (map[string]string, error) ValidateProfileRequest(req user.ProfileRequest) (map[string]string, error) ValidateRefreshTokenRequest(req user.RefreshTokenRequest) (map[string]string, error) }
Source Files
¶
Click to show internal directories.
Click to hide internal directories.