responses

package
v0.0.0-...-11c1434 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccountNotFoundResponse

func AccountNotFoundResponse() error

func BadRequestResponse

func BadRequestResponse() error

func EmailInUseErrorResponse

func EmailInUseErrorResponse() error

func InternalServerErrorResponse

func InternalServerErrorResponse() error

func InvalidEmailErrorResponse

func InvalidEmailErrorResponse() error

func InvalidTotpStateErrorResponse

func InvalidTotpStateErrorResponse() error

func NewErrorResponse

func NewErrorResponse(w http.ResponseWriter, statusCode int, message string) error

func NewJSONResponse

func NewJSONResponse(w http.ResponseWriter, statusCode int, data interface{}) error

func NewTextResponse

func NewTextResponse(w http.ResponseWriter, statusCode int, message string) error

func OAuth2ApplicationNameInUseErrorResponse

func OAuth2ApplicationNameInUseErrorResponse() error

func OAuth2ApplicationNotFoundResponse

func OAuth2ApplicationNotFoundResponse() error

func OAuth2ApplicationTypeParameterNameMismatchErrorResponse

func OAuth2ApplicationTypeParameterNameMismatchErrorResponse() error

func OAuth2InvalidScope

func OAuth2InvalidScope(scope []string) error

func OAuth2RedirectURIDoesNotMatch

func OAuth2RedirectURIDoesNotMatch() error

func OAuth2ScopeIsRequired

func OAuth2ScopeIsRequired() error

func OAuth2UserNotFoundResponse

func OAuth2UserNotFoundResponse() error

func ReturnRedirectResponseToConsentPage

func ReturnRedirectResponseToConsentPage(w http.ResponseWriter, r *http.Request, authCode datatypes.OAuthAuthorizationCode) error

func SendActivateTotpSuccessResponse

func SendActivateTotpSuccessResponse(secret, uri string, w http.ResponseWriter) error

func SendDisableTotpSuccessResponse

func SendDisableTotpSuccessResponse(w http.ResponseWriter) error

func SendEnableTotpSuccessResponse

func SendEnableTotpSuccessResponse(w http.ResponseWriter) error

func SendLoginSuccessResponse

func SendLoginSuccessResponse(accessToken, refreshToken datatypes.Token, w http.ResponseWriter) error

func SendNewOKResponse

func SendNewOKResponse(w http.ResponseWriter) error

func SendNewOKResponseMessage

func SendNewOKResponseMessage(w http.ResponseWriter, message string) error

func SendRegisterSuccessResponse

func SendRegisterSuccessResponse(w http.ResponseWriter) error

func SendTokenExchangeSuccessResponse

func SendTokenExchangeSuccessResponse(accessToken, refreshToken datatypes.Token, w http.ResponseWriter) error

func ToManyFailedAttemptsResponse

func ToManyFailedAttemptsResponse() error

func TwoFactorAuthenticationRequiredResponse

func TwoFactorAuthenticationRequiredResponse() error

func UnauthorizedErrorResponse

func UnauthorizedErrorResponse(message string) error

func ValidationErrorResponse

func ValidationErrorResponse(errors map[string]string) error

Types

type ActivateTotpSuccessResponse

type ActivateTotpSuccessResponse struct {
	Error  bool   `json:"error"`
	Secret string `json:"secret"`
	QrUri  string `json:"qr_uri"`
}

type GenericDataResponse

type GenericDataResponse struct {
	Error bool        `json:"error"`
	Data  interface{} `json:"data"`
}

type GenericResponse

type GenericResponse struct {
	Error   bool   `json:"error"`
	Message string `json:"message"`
}

type LoginErrorResponse

type LoginErrorResponse struct {
	Error       bool   `json:"error"`
	Message     string `json:"message"`
	Description string `json:"description"`
}

type LoginSuccessResponse

type LoginSuccessResponse struct {
	AccessToken  string    `json:"access_token"`
	TokenType    string    `json:"token_type"`
	ExpiresAt    time.Time `json:"expires_at"`
	RefreshToken string    `json:"refresh_token,omitempty"`
}

type RegisterSuccessResponse

type RegisterSuccessResponse struct {
	Error   bool   `json:"error"`
	Message string `json:"message"`
}

type TotpErrorResponse

type TotpErrorResponse struct {
	Error       bool   `json:"error"`
	Message     string `json:"message"`
	Description string `json:"description"`
}

type UnauthorizedErrorResponseType

type UnauthorizedErrorResponseType struct {
	Error   bool   `json:"error"`
	Message string `json:"message"`
}

type ValidationErrorResponseType

type ValidationErrorResponseType struct {
	Error  bool              `json:"error"`
	Fields map[string]string `json:"fields"`
}

Jump to

Keyboard shortcuts

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