Documentation
¶
Index ¶
- func IsNotFound(err error) bool
- type Code
- type Details
- type Error
- func ErrAlreadyExists() *Error
- func ErrBadRequest() *Error
- func ErrConflict() *Error
- func ErrExpired() *Error
- func ErrForbidden() *Error
- func ErrGone() *Error
- func ErrInternalError() *Error
- func ErrInvalid() *Error
- func ErrMethodNotAllowed() *Error
- func ErrNotAcceptable() *Error
- func ErrNotFound() *Error
- func ErrRequestEntityTooLarge() *Error
- func ErrServerTimeout() *Error
- func ErrServiceUnavailable() *Error
- func ErrTimeout() *Error
- func ErrTooManyRequests() *Error
- func ErrUnauthorized() *Error
- func ErrUnknown() *Error
- func ErrUnsupportedMediaType() *Error
- func New(code Code) *Error
- func NewWithAll(code Code, message string, details Details, httpStatusCode int) *Error
- func UnmarshallJSON(data []byte) (*Error, bool)
- func (ae *Error) Error() string
- func (ae *Error) WithDetails(details Details) *Error
- func (ae *Error) WithError(err error) *Error
- func (ae *Error) WithHttpStatusCode(statusCode int) *Error
- func (ae *Error) WithMessage(message string) *Error
- func (ae *Error) WithMessagef(format string, a ...interface{}) *Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsNotFound ¶
Types ¶
type Code ¶
type Code string
const ( CodeUnknown Code = "unknown" CodeForbidden Code = "forbidden" CodeNotFound Code = "not_found" CodeAlreadyExists Code = "already_exists" CodeConflict Code = "conflict" CodeGone Code = "gone" CodeInvalid Code = "invalid" CodeServerTimeout Code = "server_timeout" CodeTimeout Code = "timeout" CodeTooManyRequests Code = "too_many_requests" CodeBadRequest Code = "bad_request" CodeMethodNotAllowed Code = "method_not_allowed" CodeNotAcceptable Code = "not_acceptable" CodeRequestEntityTooLarge Code = "request_entity_too_large" CodeUnsupportedMediaType Code = "unsupported_media_type" CodeInternalError Code = "internal_error" CodeExpired Code = "expired" )
type Error ¶
type Error struct {
Err errorPayload `json:"error,omitempty"`
HTTPStatusCode int `json:"-"`
}
func ErrAlreadyExists ¶
func ErrAlreadyExists() *Error
func ErrBadRequest ¶
func ErrBadRequest() *Error
func ErrConflict ¶
func ErrConflict() *Error
func ErrExpired ¶
func ErrExpired() *Error
func ErrForbidden ¶
func ErrForbidden() *Error
func ErrInternalError ¶
func ErrInternalError() *Error
func ErrInvalid ¶
func ErrInvalid() *Error
func ErrMethodNotAllowed ¶
func ErrMethodNotAllowed() *Error
func ErrNotAcceptable ¶
func ErrNotAcceptable() *Error
func ErrNotFound ¶
func ErrNotFound() *Error
func ErrRequestEntityTooLarge ¶
func ErrRequestEntityTooLarge() *Error
func ErrServerTimeout ¶
func ErrServerTimeout() *Error
func ErrServiceUnavailable ¶
func ErrServiceUnavailable() *Error
func ErrTimeout ¶
func ErrTimeout() *Error
func ErrTooManyRequests ¶
func ErrTooManyRequests() *Error
func ErrUnauthorized ¶
func ErrUnauthorized() *Error
func ErrUnknown ¶
func ErrUnknown() *Error
func ErrUnsupportedMediaType ¶
func ErrUnsupportedMediaType() *Error
func NewWithAll ¶
func UnmarshallJSON ¶
func (*Error) WithDetails ¶
func (*Error) WithHttpStatusCode ¶
func (*Error) WithMessage ¶
func (*Error) WithMessagef ¶
Click to show internal directories.
Click to hide internal directories.