Documentation ¶
Index ¶
Constants ¶
View Source
const ( //ProblemReportContentType as required by https://tools.ietf.org/html/rfc7807 ProblemReportContentType string = "application/problem+json" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DetailsFunc ¶
type DetailsFunc func(p *problem) *problem
func Detail ¶
func Detail(detail string) DetailsFunc
func Instance ¶
func Instance(instance string) DetailsFunc
func InvalidParameter ¶
func InvalidParameter(property string, value any, reason string) DetailsFunc
func Title ¶
func Title(t string) DetailsFunc
func TraceID ¶
func TraceID(traceID string) DetailsFunc
type ProblemDetails ¶
type ProblemDetails interface { Code() int Type() string Title() string Detail() string Instance() string TraceID() string ContentType() string WriteResponse(w http.ResponseWriter) error }
ProblemDetails stores details about a certain problem according to RFC7807 See https://tools.ietf.org/html/rfc7807
func NewProblemReport ¶
func NewProblemReport(code int, problemType string, details ...DetailsFunc) ProblemDetails
Click to show internal directories.
Click to hide internal directories.