Documentation
¶
Overview ¶
Package problem implements application/problem+json (RFC 9457) errors with the OBX error codes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FieldError ¶
type FieldError struct {
Pointer *string `json:"pointer"`
ObxError string `json:"obx_error"`
Detail string `json:"detail"`
}
FieldError is one entry of Problem.errors.
type Problem ¶
type Problem struct {
Type string `json:"type"`
Title string `json:"title"`
Status int `json:"status"`
Detail *string `json:"detail"`
Instance *string `json:"instance,omitempty"`
ObxError string `json:"obx_error"`
Errors []FieldError `json:"errors,omitempty"`
RetryAfter *int `json:"retry_after,omitempty"`
}
Problem is the error document.
func As ¶
As converts any error to a problem (unknown errors become internal_error without leaking details).
func (*Problem) WithStatus ¶
WithStatus overrides the HTTP status (setup_required is 409 or 503).