handler

package
v0.0.0-...-cc0c475 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2019 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

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

Account handler all http request related to account

func NewAccount

func NewAccount(account service.AccountService) *Account

NewAccount create new account handler

func (*Account) ForgotPassword

func (a *Account) ForgotPassword(w http.ResponseWriter, r *http.Request)

func (*Account) Login

func (a *Account) Login(w http.ResponseWriter, r *http.Request)

func (*Account) Logout

func (a *Account) Logout(w http.ResponseWriter, r *http.Request)

func (*Account) Register

func (a *Account) Register(w http.ResponseWriter, r *http.Request)

func (*Account) ResetPassword

func (a *Account) ResetPassword(w http.ResponseWriter, r *http.Request)

func (*Account) VerifyEmailToken

func (a *Account) VerifyEmailToken(w http.ResponseWriter, r *http.Request)

func (*Account) VerifyPasswordResetToken

func (a *Account) VerifyPasswordResetToken(w http.ResponseWriter, r *http.Request)

type ErrorResponse

type ErrorResponse struct {
	Code    int    `json:"code"`
	Message string `json:"message,omitempty"`
}

ErrorResponse error json api response

type ForgotPasswordRequest

type ForgotPasswordRequest struct {
	Email string `json:"email"`
}

func (*ForgotPasswordRequest) Bind

type LoginRequest

type LoginRequest struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

func (*LoginRequest) Bind

func (h *LoginRequest) Bind(r *http.Request) error

type PasswordResetTokenRequest

type PasswordResetTokenRequest struct {
	Token string `json:"token"`
}

func (*PasswordResetTokenRequest) Bind

type RegisterRequest

type RegisterRequest struct {
	Firstname       string `json:"firstname"`
	Lastname        string `json:"lastname"`
	Email           string `json:"email"`
	Password        string `json:"password"`
	ConfirmPassword string `json:"confirmPassword"`
}

func (*RegisterRequest) Bind

func (h *RegisterRequest) Bind(r *http.Request) error

type ResetPasswordRequest

type ResetPasswordRequest struct {
	Token    string `json:"token"`
	Password string `json:"password"`
}

func (*ResetPasswordRequest) Bind

func (h *ResetPasswordRequest) Bind(r *http.Request) error

type Response

type Response struct {
	Error *ErrorResponse `json:"error,omitempty"`
	Data  interface{}    `json:"data,omitempty"`
}

Response general json api response

func (*Response) Render

func (r *Response) Render(w http.ResponseWriter, req *http.Request) error

Render render request and return corresponding response

type VerifyEmailTokenRequest

type VerifyEmailTokenRequest struct {
	Token string `json:"token"`
}

func (*VerifyEmailTokenRequest) Bind

Jump to

Keyboard shortcuts

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