Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthAPI ¶
type AuthAPI struct {
// contains filtered or unexported fields
}
func NewAuthAPI ¶
func NewAuthAPI(token *authandler.TokenHandler, auth *authandler.AuthHandler, verifycode *authandler.VerifyCodeHandler) *AuthAPI
func (*AuthAPI) Login ¶
Login @Summary Login @Description login with password, and returns jwt token pair @Tags auth @Accept json @Produce json @Param loginOption body auth.LoginOption true "login params" @Success 200 {object} types.Response{data=auth.TokenResult} @Router /auth/login [POST]
func (*AuthAPI) Refresh ¶
Refresh @Summary Refresh @Description ask for refresh access token lifetime with refresh token @Tags auth @Accept json @Produce json @Param RefreshTokenOption body auth.RefreshTokenOption true "refresh params" @Success 200 {object} types.Response{data=auth.TokenResult} @Router /auth/refresh [POST]
func (*AuthAPI) Register ¶
Register @Summary Register @Description register a new user with verification code @Tags auth @Accept json @Produce json @Param RegisterOption body auth.RegisterOption true "register params" @Success 200 {object} types.Response @Router /auth/register [POST]
func (*AuthAPI) ResetPassword ¶
ResetPassword @Summary ResetPassword @Description reset user password with verification code @Tags auth @Accept json @Produce json @Param ResetPasswordOption body auth.ResetPasswordOption true "reset params" @Success 200 {object} types.Response @Router /auth/reset [POST]
func (*AuthAPI) VerifyCode ¶
VerifyCode @Summary VerifyCode @Description send verification code mail to specified email address @Tags auth @Accept json @Produce json @Param VerifyCodeOption body auth.VerifyCodeOption true "VerifyCodeOption" @Success 200 {object} types.Response @Router /auth/code [POST]