Documentation ¶
Overview ¶
Package users @title users actions @host localhost:8090
Index ¶
- type AuthService
- type Handler
- func (h Handler) AddRoutes(e *echo.Group, m ...echo.MiddlewareFunc)
- func (h Handler) Deactivate(ctx echo.Context) error
- func (h Handler) GetProfile(ctx echo.Context) error
- func (h Handler) NewPwd(ctx echo.Context) error
- func (h Handler) PutProfile(ctx echo.Context) error
- func (h Handler) Refresh(ctx echo.Context) error
- func (h Handler) ResetPwd(ctx echo.Context) error
- func (h Handler) SignIn(ctx echo.Context) error
- func (h Handler) SignOut(ctx echo.Context) error
- func (h Handler) SignOutAll(ctx echo.Context) error
- func (h Handler) SignUp(ctx echo.Context) error
- type ProfileService
- type ResetPwdService
- type SignUpService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthService ¶
type AuthService interface { Authenticate(ctx context.Context, email, pwd, deviceID string) ( auth.AccessToken, auth.RefreshToken, error, ) SignOut(ctx context.Context, userID int, deviceID string) error SignOutAll(ctx context.Context, userID int) error Refresh(ctx context.Context, userID int, tokenUUID, deviceID string) ( auth.AccessToken, auth.RefreshToken, error, ) }
type Handler ¶
type Handler struct { common.BaseHandler // contains filtered or unexported fields }
func NewHandler ¶
func NewHandler( authService AuthService, signinService SignUpService, pwdResetService ResetPwdService, profileService ProfileService, ) Handler
func (Handler) Deactivate ¶
Deactivate
@Summary Deactivate Profile @Description Deactivate Profile @Tags users @Accept json @Produce json @Success 204 {object} common.EmptyResponse @Failure 400 {object} common.ErrorResponse @Failure 401 {object} common.ErrorResponse @Failure 403 {object} common.ErrorResponse @Failure 404 {object} common.ErrorResponse @Failure 500 {object} common.ErrorResponse @Router /v1/user/profile/deactivate [POST]
func (Handler) GetProfile ¶
GetProfile
@Summary GetProfile @Description GetProfile @Tags users @Accept json @Produce json @Success 200 {object} profileResponse @Failure 400 {object} common.ErrorResponse @Failure 401 {object} common.ErrorResponse @Failure 403 {object} common.ErrorResponse @Failure 404 {object} common.ErrorResponse @Failure 500 {object} common.ErrorResponse @Router /v1/user/profile [GET]
func (Handler) NewPwd ¶
NewPwd
@Summary New Password @Description Set password reset confirmation request @Tags users @Accept json @Param setPwd body newPasswordRequest true "user pwd" @Param token path string true "pwd reset token" @Success 204 {object} common.EmptyResponse @Failure 400 {object} common.ErrorResponse @Failure 401 {object} common.ErrorResponse @Failure 403 {object} common.ErrorResponse @Failure 404 {object} common.ErrorResponse @Failure 500 {object} common.ErrorResponse @Router /v1/set-password/{token} [PUT]
func (Handler) PutProfile ¶
PutProfile
@Summary PutProfile @Description PutProfile @Tags users @Accept json @Produce json @Success 204 {object} common.EmptyResponse @Param profile body profileRequest true "profile update" @Failure 400 {object} common.ErrorResponse @Failure 401 {object} common.ErrorResponse @Failure 403 {object} common.ErrorResponse @Failure 404 {object} common.ErrorResponse @Failure 500 {object} common.ErrorResponse @Router /v1/user/profile [PATCH]
func (Handler) Refresh ¶
Refresh
@Summary Refresh User Access and Refresh token @Description Refresh User Access Refresh token @Tags auth @Accept json @Produce json @Success 200 {object} authToken @Failure 400 {object} common.ErrorResponse @Failure 401 {object} common.ErrorResponse @Failure 403 {object} common.ErrorResponse @Failure 404 {object} common.ErrorResponse @Failure 500 {object} common.ErrorResponse @Security ApiKeyAuth @Router /v1/refresh-token [PUT]
func (Handler) ResetPwd ¶
ResetPwd
@Summary Reset Password @Description User password reset confirmation request @Tags users @Accept json @Param resetEmail body resetPwdRequest true "user email" @Success 204 {object} common.EmptyResponse @Failure 400 {object} common.ErrorResponse @Failure 401 {object} common.ErrorResponse @Failure 403 {object} common.ErrorResponse @Failure 404 {object} common.ErrorResponse @Failure 500 {object} common.ErrorResponse @Router /v1/reset-password [POST]
func (Handler) SignIn ¶
SignIn
@Summary SignIn User @Description SignIn User @Tags auth @Accept json @Produce json @Success 200 {object} authToken @Param signInUser body signIn true "user login" @Failure 400 {object} common.ErrorResponse @Failure 401 {object} common.ErrorResponse @Failure 403 {object} common.ErrorResponse @Failure 404 {object} common.ErrorResponse @Failure 500 {object} common.ErrorResponse @Router /v1/sign-in [POST]
func (Handler) SignOut ¶
SignOut
@Summary SignOut User @Description SignOut User @Tags auth @Accept json @Produce json @Success 204 {object} common.EmptyResponse @Failure 400 {object} common.ErrorResponse @Failure 401 {object} common.ErrorResponse @Failure 403 {object} common.ErrorResponse @Failure 404 {object} common.ErrorResponse @Failure 500 {object} common.ErrorResponse @Security ApiKeyAuth @Router /v1/sign-out [PUT]
func (Handler) SignOutAll ¶
SignOutAll
@Summary SignOut User @Description SignOut User @Tags auth @Accept json @Produce json @Success 204 {object} common.EmptyResponse @Failure 400 {object} common.ErrorResponse @Failure 401 {object} common.ErrorResponse @Failure 403 {object} common.ErrorResponse @Failure 404 {object} common.ErrorResponse @Failure 500 {object} common.ErrorResponse @Security ApiKeyAuth @Router /v1/sign-out/all [PUT]
func (Handler) SignUp ¶
SignUp
@Summary SignUp User @Description SignUp User and send verification email @Tags registration @Accept json @Produce json @Success 200 {object} authToken @Param signUpUser body signUpRequest true "user data" @Failure 400 {object} common.ErrorResponse @Failure 401 {object} common.ErrorResponse @Failure 403 {object} common.ErrorResponse @Failure 404 {object} common.ErrorResponse @Failure 500 {object} common.ErrorResponse @Router /v1/sign-up [POST]