Documentation
¶
Index ¶
- func ChiMiddleware(next http.Handler) http.Handler
- func FiberMiddleware() fiber.Handler
- func GinMiddleware() gin.HandlerFunc
- func IsUniqueConstraintViolation(err error) bool
- func NetHTTPMiddleware(next http.Handler) http.Handler
- type Error
- func BadRequestError(msg string) Error
- func ConflictError(msg string) Error
- func ForbiddenError(msg string) Error
- func InternalServerError(msg string) Error
- func New(message string, httpStatus int) Error
- func NotFoundError(msg string) Error
- func ServiceUnavailableError(msg string) Error
- func TooManyRequestsError(msg string) Error
- func UnauthorizedError(msg string) Error
- func UnprocessableEntityError(msg string) Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChiMiddleware ¶
Chi Middleware for centralized error handling
func FiberMiddleware ¶
func FiberMiddleware() fiber.Handler
FiberMiddleware for centralized error handling
func GinMiddleware ¶
func GinMiddleware() gin.HandlerFunc
GinMiddleware handles all errors centrally
func IsUniqueConstraintViolation ¶
IsUniqueConstraintViolation checks for unique constraint violations
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
func BadRequestError ¶
func ConflictError ¶
func ForbiddenError ¶
func InternalServerError ¶
func NotFoundError ¶
func ServiceUnavailableError ¶
func TooManyRequestsError ¶
func UnauthorizedError ¶
func (Error) HttpStatus ¶
Click to show internal directories.
Click to hide internal directories.