account

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(broker brokerLib.IBroker, databaseRead SQL.InterfaceRead,
	databaseWrite SQL.InterfaceWrite, cache cacheRepository.Interface, appConfig app.IAppConfig) *Handler

func (*Handler) ChangePassword

func (h *Handler) ChangePassword(w http.ResponseWriter, r *http.Request)

@Tags Account @Description change password! @ID change-password @Accept json @Produce json @Param password body string true "new password" @Success 204 {object} http.Response{content=string} "NO CONTENT" @Failure 400 {object} http.Response{content=string} "BAD REQUEST" @Failure 401 {object} http.Response{content=string} "UNAUTHORIZED" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /api/account/change-password [post] @Security ApiKeyAuth

func (*Handler) CreateAccount

func (h *Handler) CreateAccount(w http.ResponseWriter, r *http.Request)

@Tags Account @Description Create a new account! @ID create-account @Accept json @Produce json @Param CreateAccount body account.CreateAccount true "create account info" @Success 201 {object} http.Response{content=string} "STATUS CREATED" @Failure 400 {object} http.Response{content=string} "BAD REQUEST" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /api/account/create-account [post]

func (*Handler) Login

func (h *Handler) Login(w http.ResponseWriter, r *http.Request)

@Tags Account @Description login into account! @ID login @Accept json @Produce json @Param LoginData body account.LoginData true "login data info" @Success 200 {object} http.Response{content=string} "OK" @Failure 400 {object} http.Response{content=string} "BAD REQUEST" @Failure 401 {object} http.Response{content=string} "UNAUTHORIZED" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /api/account/login [post]

func (*Handler) Logout

func (h *Handler) Logout(w http.ResponseWriter, r *http.Request)

@Tags Account @Description logout! @ID logout @Accept json @Produce json @Success 200 {object} http.Response{content=string} "NO CONTENT" @Failure 401 {object} http.Response{content=string} "UNAUTHORIZED" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /api/account/logout [post] @Security ApiKeyAuth

func (*Handler) Options

func (h *Handler) Options(w http.ResponseWriter, r *http.Request)

func (*Handler) RenewToken

func (h *Handler) RenewToken(w http.ResponseWriter, r *http.Request)

@Tags Account @Description renew token! @ID renew-token @Accept json @Produce json @Param refreshToken body string true "refresh token" @Success 200 {object} http.Response{content=string} "OK" @Failure 400 {object} http.Response{content=string} "BAD REQUEST" @Failure 401 {object} http.Response{content=string} "UNAUTHORIZED" @Router /api/account/renew-token [post] @Security ApiKeyAuth

func (*Handler) SendResetPasswordCode

func (h *Handler) SendResetPasswordCode(w http.ResponseWriter, r *http.Request)

@Tags Account @Description send reset password code! @ID reset-password-code @Accept json @Produce json @Param EmailData body account.EmailData true "reset password email info" @Success 204 {object} http.Response{content=string} "NO CONTENT" @Failure 400 {object} http.Response{content=string} "BAD REQUEST" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /api/account/send-code [post]

func (*Handler) ValidateEmail

func (h *Handler) ValidateEmail(w http.ResponseWriter, r *http.Request)

@Tags Account @Description validate email! @ID validate-email @Accept json @Produce json @Param accountID path string true "accountID of the account" @Success 200 {object} http.Response{content=string} "OK" @Failure 400 {object} http.Response{content=string} "BAD REQUEST" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /api/account/validate/{accountID} [get]

func (*Handler) ValidateResetPasswordCode

func (h *Handler) ValidateResetPasswordCode(w http.ResponseWriter, r *http.Request)

@Tags Account @Description validate reset password code! @ID validate-password-code @Accept json @Produce json @Param ResetCodeData body account.ResetCodeData true "reset password data info" @Success 204 {object} http.Response{content=string} "NO CONTENT" @Failure 400 {object} http.Response{content=string} "BAD REQUEST" @Failure 401 {object} http.Response{content=string} "UNAUTHORIZED" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /api/account/validate-code [post]

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL