Problem
Problem(v interface{}, opts ...ProblemOptions) (int, error)// ProblemOptions the optional settings when server replies with a Problem.
// See `Context.Problem` method and `Problem` type for more details.
type ProblemOptions struct {
// JSON are the optional JSON renderer options.
JSON JSON
// RenderXML set to true if want to render as XML doc.
// See `XML` option field too.
RenderXML bool
// XML are the optional XML renderer options.
// Affect only when `RenderXML` field is set to true.
XML XML
// RetryAfter sets the Retry-After response header.
// https://tools.ietf.org/html/rfc7231#section-7.1.3
// The value can be one of those:
// time.Time
// time.Duration for seconds
// int64, int, float64 for seconds
// string for duration string or for datetime string.
//
// Examples:
// time.Now().Add(5 * time.Minute),
// 300 * time.Second,
// "5m",
// 300
RetryAfter interface{}
// A function that, if specified, can dynamically set
// retry-after based on the request. Useful for ProblemOptions reusability.
// Should return time.Time, time.Duration, int64, int, float64 or string.
//
// Overrides the RetryAfter field.
RetryAfterFunc func(Context) interface{}
}Last updated
Was this helpful?