Documentation
¶
Overview ¶
Package problem renders errors as RFC 9457 problem details (application/problem+json), attaching the active trace ID so a failed response can be traced back to its span.
Index ¶
Constants ¶
View Source
const ContentType = "application/problem+json"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FieldError ¶
type Problem ¶
type Problem struct {
Type string `json:"type"`
Title string `json:"title"`
Status int `json:"status"`
Detail string `json:"detail,omitempty"`
Instance string `json:"instance,omitempty"`
TraceID string `json:"traceId,omitempty"`
Errors []FieldError `json:"errors,omitempty"`
}
Problem is an RFC 9457 problem details object.
func New ¶
New builds a problem with type "about:blank" and the standard title for the status code, per RFC 9457 section 4.2.1.
Click to show internal directories.
Click to hide internal directories.