Documentation ¶
Index ¶
- Variables
- func Errorf(he *HTTPError, format string, a ...any) error
- func Read(r *http.Request, obj any) error
- func ReadError(resp *resty.Response) error
- func Write(w http.ResponseWriter, obj any) error
- func WriteError(w http.ResponseWriter, err error)
- func WriteList(w http.ResponseWriter, list []any, etag string) error
- type HTTPError
- type JSONError
- type SilentJoinError
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrBadRequest = NewHTTPError(http.StatusBadRequest) ErrPaymentRequired = NewHTTPError(http.StatusPaymentRequired) ErrForbidden = NewHTTPError(http.StatusForbidden) ErrNotFound = NewHTTPError(http.StatusNotFound) ErrMethodNotAllowed = NewHTTPError(http.StatusMethodNotAllowed) ErrNotAcceptable = NewHTTPError(http.StatusNotAcceptable) ErrProxyAuthRequired = NewHTTPError(http.StatusProxyAuthRequired) ErrRequestTimeout = NewHTTPError(http.StatusRequestTimeout) ErrConflict = NewHTTPError(http.StatusConflict) ErrGone = NewHTTPError(http.StatusGone) ErrLengthRequired = NewHTTPError(http.StatusLengthRequired) ErrPreconditionFailed = NewHTTPError(http.StatusPreconditionFailed) ErrRequestEntityTooLarge = NewHTTPError(http.StatusRequestEntityTooLarge) ErrRequestURITooLong = NewHTTPError(http.StatusRequestURITooLong) ErrUnsupportedMediaType = NewHTTPError(http.StatusUnsupportedMediaType) ErrRequestedRangeNotSatisfiable = NewHTTPError(http.StatusRequestedRangeNotSatisfiable) ErrExpectationFailed = NewHTTPError(http.StatusExpectationFailed) ErrTeapot = NewHTTPError(http.StatusTeapot) ErrMisdirectedRequest = NewHTTPError(http.StatusMisdirectedRequest) ErrUnprocessableEntity = NewHTTPError(http.StatusUnprocessableEntity) ErrLocked = NewHTTPError(http.StatusLocked) ErrFailedDependency = NewHTTPError(http.StatusFailedDependency) ErrTooEarly = NewHTTPError(http.StatusTooEarly) ErrUpgradeRequired = NewHTTPError(http.StatusUpgradeRequired) ErrPreconditionRequired = NewHTTPError(http.StatusPreconditionRequired) ErrTooManyRequests = NewHTTPError(http.StatusTooManyRequests) ErrRequestHeaderFieldsTooLarge = NewHTTPError(http.StatusRequestHeaderFieldsTooLarge) ErrInternalServerError = NewHTTPError(http.StatusInternalServerError) ErrNotImplemented = NewHTTPError(http.StatusNotImplemented) ErrBadGateway = NewHTTPError(http.StatusBadGateway) ErrGatewayTimeout = NewHTTPError(http.StatusGatewayTimeout) ErrHTTPVersionNotSupported = NewHTTPError(http.StatusHTTPVersionNotSupported) ErrVariantAlsoNegotiates = NewHTTPError(http.StatusVariantAlsoNegotiates) ErrInsufficientStorage = NewHTTPError(http.StatusInsufficientStorage) ErrLoopDetected = NewHTTPError(http.StatusLoopDetected) ErrNotExtended = NewHTTPError(http.StatusNotExtended) ErrNetworkAuthenticationRequired = NewHTTPError(http.StatusNetworkAuthenticationRequired) )
View Source
var ErrUnsupportedContentType = errors.New("unsupported Content-Type")
Functions ¶
func WriteError ¶
func WriteError(w http.ResponseWriter, err error)
Types ¶
type JSONError ¶
func ToJSONError ¶
type SilentJoinError ¶
type SilentJoinError struct {
Wraps []error
}
func SilentJoin ¶
func SilentJoin(errs ...error) *SilentJoinError
func (*SilentJoinError) Error ¶
func (err *SilentJoinError) Error() string
func (*SilentJoinError) Unwrap ¶
func (err *SilentJoinError) Unwrap() []error
Click to show internal directories.
Click to hide internal directories.