Documentation ¶
Index ¶
- Variables
- func CompactJSON(data []byte) string
- func GetReqID(ctx context.Context) string
- func PanicIfNeeded(err interface{})
- func ParseHttpError(err error) (int, interface{})
- type HttpErr
- func NewAuthenticationFailedError(details interface{}) HttpErr
- func NewBadRequestError(details interface{}) HttpErr
- func NewForbiddenError(details interface{}) HttpErr
- func NewHttpError(status int, err string, details interface{}) HttpErr
- func NewInternalServerError(details interface{}) HttpErr
- func NewInvalidInputError(errs validation.Errors) HttpErr
- func NewNotFoundError(details interface{}) HttpErr
- func NewUnauthorizedError(details interface{}) HttpErr
- func NewUnprocessableEntityError(details interface{}) HttpErr
- type HttpError
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrBadRequest = errors.New("bad request") ErrWrongCredentials = errors.New("wrong credentials") ErrNotFound = errors.New("not found") ErrForbidden = errors.New("forbidden") ErrPermissionDenied = errors.New("permission denied") ErrExpiredCSRFError = errors.New("expired CSRF token") ErrWrongCSRFToken = errors.New("wrong CSRF token") ErrCSRFNotPresented = errors.New("CSRF not presented") ErrNotRequiredFields = errors.New("no such required fields") ErrBadQueryParams = errors.New("invalid query params") ErrInternalServerError = errors.New("internal server error") ErrRequestTimeoutError = errors.New("request timeout") ErrExistsEmailError = errors.New("user with given email already exists") ErrInvalidJWTToken = errors.New("invalid JWT token") ErrInvalidJWTClaims = errors.New("invalid JWT claims") ErrNotAllowedImageHeader = errors.New("not allowed image header") ErrNoCookie = errors.New("not found cookie header") ErrUnprocessableEntity = errors.New("unprocessable entity") ErrAuthenticationFailed = errors.New("authentication vailed") )
Functions ¶
func CompactJSON ¶ added in v1.0.2
func PanicIfNeeded ¶ added in v1.0.5
func PanicIfNeeded(err interface{})
PanicIfNeeded is panic if needed
func ParseHttpError ¶ added in v1.0.2
Parse Http Error
Types ¶
type HttpErr ¶ added in v1.0.2
HttpErr interface
func NewAuthenticationFailedError ¶ added in v1.0.2
func NewAuthenticationFailedError(details interface{}) HttpErr
New Authentication Failed Error
func NewBadRequestError ¶ added in v1.0.2
func NewBadRequestError(details interface{}) HttpErr
New Bad Request Error
func NewForbiddenError ¶ added in v1.0.2
func NewForbiddenError(details interface{}) HttpErr
New Forbidden Error
func NewHttpError ¶ added in v1.0.2
New Http Error
func NewInternalServerError ¶ added in v1.0.2
func NewInternalServerError(details interface{}) HttpErr
New Internal Server Error
func NewInvalidInputError ¶ added in v1.0.2
func NewInvalidInputError(errs validation.Errors) HttpErr
New Invalid Input Error - Validation
func NewUnauthorizedError ¶ added in v1.0.2
func NewUnauthorizedError(details interface{}) HttpErr
New Unauthorized Error
func NewUnprocessableEntityError ¶ added in v1.0.2
func NewUnprocessableEntityError(details interface{}) HttpErr
New Unprocessable Entity Error
type HttpError ¶ added in v1.0.2
type HttpError struct { ErrStatus int `json:"status"` ErrError string `json:"error"` ErrDetails interface{} `json:"details"` }
HttpError struct
func (HttpError) Details ¶ added in v1.0.2
func (e HttpError) Details() interface{}
HttpError Details
Click to show internal directories.
Click to hide internal directories.