Documentation ¶
Index ¶
- func IsNotFound(err error) bool
- type Code
- type Details
- type Error
- func ErrAlreadyExists(messages ...string) *Error
- func ErrBadRequest(messages ...string) *Error
- func ErrConflict(messages ...string) *Error
- func ErrExpired(messages ...string) *Error
- func ErrForbidden(messages ...string) *Error
- func ErrGone(messages ...string) *Error
- func ErrInternalError(messages ...string) *Error
- func ErrInvalid(messages ...string) *Error
- func ErrMethodNotAllowed(messages ...string) *Error
- func ErrNotAcceptable(messages ...string) *Error
- func ErrNotFound(messages ...string) *Error
- func ErrRequestEntityTooLarge(messages ...string) *Error
- func ErrServerTimeout(messages ...string) *Error
- func ErrServiceUnavailable(messages ...string) *Error
- func ErrTimeout(messages ...string) *Error
- func ErrTooManyRequests(messages ...string) *Error
- func ErrUnauthorized(messages ...string) *Error
- func ErrUnknown(messages ...string) *Error
- func ErrUnsupportedMediaType(messages ...string) *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
- func (ae *Error) WithMessages(messages ...string) *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 ErrBadRequest ¶
func ErrConflict ¶
func ErrExpired ¶
func ErrForbidden ¶
func ErrInternalError ¶
func ErrInvalid ¶
func ErrMethodNotAllowed ¶
func ErrNotAcceptable ¶
func ErrNotFound ¶
func ErrServerTimeout ¶
func ErrServiceUnavailable ¶
func ErrTimeout ¶
func ErrTooManyRequests ¶
func ErrUnauthorized ¶
func ErrUnknown ¶
func ErrUnsupportedMediaType ¶
func NewWithAll ¶
func UnmarshallJSON ¶
func (*Error) WithDetails ¶
func (*Error) WithHttpStatusCode ¶
func (*Error) WithMessage ¶
func (*Error) WithMessagef ¶
func (*Error) WithMessages ¶
Click to show internal directories.
Click to hide internal directories.