Documentation
¶
Index ¶
- Variables
- func UnmarshalRequestBody(req *http.Request, v interface{}) error
- func WriteResponseTo(rw http.ResponseWriter, r Response) error
- type ErrorCode
- type ErrorResponse
- func AccessDeniedErrorResponse() *ErrorResponse
- func InternalServerErrorResponse(err string) *ErrorResponse
- func InvalidCredentialsErrorResponse() *ErrorResponse
- func InvalidPasswordResponse() *ErrorResponse
- func InvalidRequestErrorResponse(err string) *ErrorResponse
- func MethodNotAllowedResponse(method string) *ErrorResponse
- func PasswordStrengthErrorResponse(err string) *ErrorResponse
- func TooManyAttemptsResponse() *ErrorResponse
- func UnauthorizedErrorResponse(err string) *ErrorResponse
- func UserExistsResponse() *ErrorResponse
- func UsernameExistsResponse() *ErrorResponse
- type Response
- type ValidateBasicAuthHeaderOutput
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoAuthHeader = errors.New("authorization header is empty")
Functions ¶
func UnmarshalRequestBody ¶
func WriteResponseTo ¶
func WriteResponseTo(rw http.ResponseWriter, r Response) error
Types ¶
type ErrorCode ¶
type ErrorCode int
func (ErrorCode) MarshalJSON ¶
func (*ErrorCode) UnmarshalJSON ¶
type ErrorResponse ¶
type ErrorResponse struct { Error ErrorCode `json:"error,omitempty"` ErrorDescription string `json:"error_description,omitempty"` ErrorUri string `json:"error_uri,omitempty"` }
func AccessDeniedErrorResponse ¶
func AccessDeniedErrorResponse() *ErrorResponse
func InternalServerErrorResponse ¶
func InternalServerErrorResponse(err string) *ErrorResponse
func InvalidCredentialsErrorResponse ¶
func InvalidCredentialsErrorResponse() *ErrorResponse
func InvalidPasswordResponse ¶
func InvalidPasswordResponse() *ErrorResponse
func InvalidRequestErrorResponse ¶
func InvalidRequestErrorResponse(err string) *ErrorResponse
func MethodNotAllowedResponse ¶
func MethodNotAllowedResponse(method string) *ErrorResponse
func PasswordStrengthErrorResponse ¶
func PasswordStrengthErrorResponse(err string) *ErrorResponse
func TooManyAttemptsResponse ¶
func TooManyAttemptsResponse() *ErrorResponse
func UnauthorizedErrorResponse ¶
func UnauthorizedErrorResponse(err string) *ErrorResponse
func UserExistsResponse ¶
func UserExistsResponse() *ErrorResponse
func UsernameExistsResponse ¶
func UsernameExistsResponse() *ErrorResponse
func (*ErrorResponse) StatusHTTP ¶
func (r *ErrorResponse) StatusHTTP() int
type ValidateBasicAuthHeaderOutput ¶
func ValidateBasicAuthHeader ¶
func ValidateBasicAuthHeader( req *http.Request, ) (*ValidateBasicAuthHeaderOutput, error)
Click to show internal directories.
Click to hide internal directories.