Documentation
¶
Index ¶
- Constants
- type Error
- func As(err error) *Error
- func BadRequest(message string, cause error) *Error
- func Forbidden(message string, cause error) *Error
- func Internal(message string, cause error) *Error
- func MethodNotAllowed(message string, cause error) *Error
- func New(code string, status int, message string, cause error) *Error
- func NotFound(message string, cause error) *Error
- func PayloadTooLarge(message string, cause error) *Error
- func RateLimited(message string, cause error) *Error
- func Timeout(message string, cause error) *Error
- func Unauthorized(message string, cause error) *Error
- func Validation(message string, cause error) *Error
Constants ¶
View Source
const ( CodeInternal = "internal" CodeNotFound = "not_found" CodeBadRequest = "bad_request" CodeValidation = "validation" CodeForbidden = "forbidden" CodePayloadTooLarge = "payload_too_large" CodeRateLimited = "rate_limited" CodeTimeout = "timeout" CodeMethodNotAllowed = "method_not_allowed" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Error ¶
Error represents a structured application error.
func BadRequest ¶
BadRequest creates a bad request error.
func MethodNotAllowed ¶
MethodNotAllowed creates a method not allowed error.
func PayloadTooLarge ¶
PayloadTooLarge creates a payload too large error.
func RateLimited ¶
RateLimited creates a rate limited error.
func Unauthorized ¶
Unauthorized creates an unauthorized error.
func Validation ¶
Validation creates a validation error.
Click to show internal directories.
Click to hide internal directories.