Documentation
¶
Index ¶
- Variables
- func EnsureHasKey[K comparable, V any](value map[K]V, key K, format string, args ...any)
- func EnsureNotEmpty(pointer any, format string, args ...any)
- func EnsureNotNil(pointer any, format string, args ...any)
- func IsNotFound(err error) bool
- func New(msg string, httpStatus int) error
- func NewCancellationError(entity string, keyFmt string, args ...interface{}) error
- func NewConditionNotMetError(entity string, keyFmt string, args ...interface{}) error
- func NewDuplicateError(entity string, details string, keyFmt string, args ...interface{}) error
- func NewForbiddenError(entity string, keyFmt string, args ...interface{}) error
- func NewFoundManyError(entity string, keyFmt string, args ...interface{}) error
- func NewGatewayError(entity string, keyFmt string, args ...interface{}) error
- func NewInvalidArgumentError(entity string, keyFmt string, args ...interface{}) error
- func NewInvalidEventTypeError(entity string, keyFmt string, args ...interface{}) error
- func NewInvalidStateError(entity string, keyFmt string, args ...interface{}) error
- func NewNotFoundError(entity string, keyFmt string, args ...interface{}) error
- func NewTimeoutError(entity string, keyFmt string, args ...interface{}) error
- func NewTypeAssertionError(entity string, keyFmt string, args ...interface{}) error
- func NewUnauthorized(keyFmt string, args ...interface{}) error
- func NewUnknownError(entity string, details string, keyFmt string, args ...interface{}) error
- type HttpError
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = New("not found for", http.StatusNotFound) ErrDuplicate = New("duplicate", http.StatusConflict) ErrFoundMany = New("found many but one expected", http.StatusConflict) ErrTypeAssertion = New("type assertion failed", http.StatusInternalServerError) ErrUnknown = New("unknown error found", http.StatusInternalServerError) ErrInvalidArgument = New("invalid argument", http.StatusBadRequest) ErrInvalidState = New("invalid state", http.StatusPreconditionFailed) ErrClientCanceled = New("client cancelled", 460) ErrTimeout = New("timeout", http.StatusGatewayTimeout) ErrGateway = New("gateway", http.StatusBadGateway) ErrForbidden = New("forbidden", http.StatusForbidden) // Not enough permissions ErrInvalidEventType = New("invalid event type", http.StatusInternalServerError) ErrConditionNotMet = New("condition not met", http.StatusPreconditionFailed) )
Functions ¶
func EnsureHasKey ¶
func EnsureHasKey[K comparable, V any](value map[K]V, key K, format string, args ...any)
EnsureHasKey panics if the given map does not contain the given key.
func EnsureNotEmpty ¶
EnsureNotEmpty panics if the given pointer is nil, or value is empty string, or numeric 0.
func EnsureNotNil ¶
EnsureNotNil panics if the given pointer is nil. Deprecated: Use EnsureNotEmpty instead.
func IsNotFound ¶
func NewCancellationError ¶
func NewConditionNotMetError ¶ added in v0.28.0
func NewDuplicateError ¶
func NewForbiddenError ¶
func NewFoundManyError ¶
func NewGatewayError ¶
func NewInvalidArgumentError ¶
func NewInvalidStateError ¶
func NewNotFoundError ¶
func NewTimeoutError ¶
func NewTypeAssertionError ¶
func NewUnauthorized ¶
Types ¶
type HttpError ¶ added in v0.31.0
type HttpError struct {
// contains filtered or unexported fields
}
func (HttpError) HTTPStatus ¶ added in v0.31.0
Click to show internal directories.
Click to hide internal directories.