Documentation
¶
Index ¶
- Constants
- func EnsureHasKey[K comparable, V any](value map[K]V, key K, format string, args ...any)
- func EnsureNotEmpty(value string, format string, args ...any)
- func EnsureNotNil(pointer any, format string, args ...any)
- func IsNotFound(err error) bool
- type Error
- func NewCancellationError(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
Constants ¶
View Source
const ( NotFoundReason = "not found for" DuplicateReason = "duplicate" FoundManyReason = "found many but one expected" TypeAssertionReason = "type assertion failed" UnknownReason = "unknown error found" InvalidArgumentReason = "invalid argument" InvalidStateReason = "invalid state" ClientCanceledReason = "client cancelled" TimeoutReason = "timeout" GatewayReason = "gateway" ForbiddenReason = "forbidden" InvalidEventTypeReason = "invalid event type" )
Variables ¶
This section is empty.
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 string is empty.
func EnsureNotNil ¶
EnsureNotNil panics if the given pointer is nil.
func IsNotFound ¶
Types ¶
type Error ¶
type Error struct {
Entity string
Key string
Reason string
Details string
// contains filtered or unexported fields
}
func NewCancellationError ¶
func NewDuplicateError ¶
func NewForbiddenError ¶
func NewFoundManyError ¶
func NewGatewayError ¶
func NewInvalidArgumentError ¶
func NewInvalidStateError ¶
func NewNotFoundError ¶
func NewTimeoutError ¶
func NewTypeAssertionError ¶
func NewUnauthorized ¶
func NewUnknownError ¶
func (Error) HTTPStatus ¶
Click to show internal directories.
Click to hide internal directories.