Documentation
¶
Index ¶
- func WriteError(ctx context.Context, w http.ResponseWriter, err error)
- type Error
- func As(err error) *Error
- func BadRequest(opts ...Option) *Error
- func Forbidden(opts ...Option) *Error
- func Internal(opts ...Option) *Error
- func NotFound(opts ...Option) *Error
- func ServiceUnavailable(opts ...Option) *Error
- func TooManyRequests(opts ...Option) *Error
- func Unauthorized(opts ...Option) *Error
- func Validation(fields map[string]string, opts ...Option) *Error
- type Option
- type RateLimitInfo
- type ValidationInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteError ¶
func WriteError(ctx context.Context, w http.ResponseWriter, err error)
Types ¶
type Error ¶
type Error struct {
StatusCode int
Message string
Cause error
RateLimit *RateLimitInfo
Validation *ValidationInfo
}
func BadRequest ¶
func ServiceUnavailable ¶
func TooManyRequests ¶
func Unauthorized ¶
type RateLimitInfo ¶
type ValidationInfo ¶
Click to show internal directories.
Click to hide internal directories.