As is a convenient shorthand for calling errors.As with a Problem target, however, it also gracefully handles the case where err is nil without a panic.
AsMatch is a convenient shorthand for calling errors.As with a Problem target, however, it also gracefully handles the case where err is nil without a panic.
AsMatchOrElse is a convenient shorthand for calling errors.As with a Problem target, however, it also gracefully handles the case where err is nil without a panic.
AsMatchOrElseGet is a convenient shorthand for calling errors.As with a Problem target, however, it also gracefully handles the case where err is nil without a panic.
AsOrElse is a convenient shorthand for calling errors.As with a Problem target, however, it also gracefully handles the case where err is nil without a panic.
AsOrElseGet is a convenient shorthand for calling errors.As with a Problem target, however, it also gracefully handles the case where err is nil without a panic.
Build is a convenient shorthand for calling Generator.Build on DefaultGenerator.
BuildCode is a convenient shorthand for calling Coder.Build on a Coder using DefaultGenerator and optionally a given NS.
BuildContext is a convenient shorthand for calling Generator.BuildContext on the Generator within the given context.Context, if any, otherwise DefaultGenerator.
ComposeNSValidator returns a NSValidator composed of each of the given validators.
DefaultLogger returns a Logger that uses slog.Default and is used by DefaultGenerator.
FromDefinition customizes a Generator to return a Problem using the given Definition when building a Problem.
FromType customizes a Generator to return a Problem using the given Type when building a Problem.
FullUnwrapper returns an Unwrapper that extracts all fields from a wrapped Problem in err's tree, if present.
GetGenerator returns the Generator within the given context.Context, otherwise DefaultGenerator.
HasCode is used to match a Problem based on its Code.
HasCodeNS is used to match a Problem based on the NS within its Code using DefaultGenerator.
HasCodeNSUsing is used to match a Problem based on the NS within its Code using the given Generator.
HasCodeValue is used to match a Problem based on the value within its Code using DefaultGenerator.
HasCodeValueUsing is used to match a Problem based on the value within its Code using the given Generator.
HasDetail is used to match a Problem based on its detail.
HasExtension is used to match a Problem based on whether it contains an extension with the given key.
HasExtensions is used to match a Problem based on whether it contains extensions with the given keys.
HasInstance is used to match a Problem based on its instance.
HasStack is used to match a Problem based on whether it has a captured stack trace.
HasStatus is used to match a Problem based on its status.
HasTitle is used to match a Problem based on its title.
HasType is used to match a Problem based on its type URI.
HasUUID is used to match a Problem based on whether it has a generated UUID.
Is acts as a substitute for errors.Is, returning true if err's tree contains a Problem.
IsMatch acts as a substitute for errors.Is, returning true if err's tree contains a Problem that matches all matchers provided.
LenNSValidator returns a NSValidator that asserts that a NS contains at least the minimum and, optionally, at most the maximum number of characters.
Log is a convenient shorthand for calling Generator.Log on DefaultGenerator.
LogContext is a convenient shorthand for calling Generator.LogContext on the Generator within the given context.Context, if any, otherwise DefaultGenerator.
LoggerFrom returns a Logger that uses the given slog.Logger.
Match returns whether the given Problem matchers all the matchers provided.
Middleware is a convenient shorthand for calling MiddlewareUsing with DefaultGenerator.
MiddlewareUsing returns a middleware function that is responsible for populating the HTTP request's context.Context with the given Generator (which can be retrieved using GetGenerator) and also provides panic recovery, allowing recovered values to be used to form Problem HTTP responses, optionally using WriteOptions for more granular control.
MustBuildCode is a convenient shorthand for calling Coder.MustBuild on a Coder using DefaultGenerator and optionally a given NS.
MustParseCode is a convenient shorthand for calling Coder.MustParse on a Coder using DefaultGenerator and optionally a given NS.
MustValidateCode is a convenient shorthand for calling Coder.MustValidate on a Coder using DefaultGenerator and optionally a given NS.
New is a convenient shorthand for calling Generator.New on DefaultGenerator.
NewContext is a convenient shorthand for calling Generator.NewContext on the Generator within the given context.Context, if any, otherwise DefaultGenerator.
NoopLogger returns a Logger that does nothing.
NoopTranslator returns a Translator that always returns an empty string, forcing the Problem to be constructed using a fallback value for the associated field.
NoopUnwrapper returns an Unwrapper that does nothing.
Or is used to match a Problem on any of the given matchers.
ParseCode is a convenient shorthand for calling Coder.Parse on a Coder using DefaultGenerator and optionally a given NS.
PropagatedFieldUnwrapper returns an Unwrapper that extracts only fields that are expected to be propagated (e.g.
RegexpNSValidator returns a NSValidator that asserts that a NS matches the given regular expression.
UnicodeNSValidator returns a NSValidator that asserts that a NS contains only unicode runes that meet the given predicate.
UsingGenerator returns a copy of the given parent context.Context containing the Generator provided.
V4UUIDGenerator returns a UUIDGenerator that generates a (V4) UUID and is used by DefaultGenerator.
V4UUIDGeneratorFromReader returns a UUIDGenerator that generates a (V4) UUID based on bytes read from the given reader.
ValidateCode is a convenient shorthand for calling Coder.Validate on a Coder using DefaultGenerator and optionally a given NS.
WithCode customizes a Generator to return a Problem with the given Code.
WithDetail customizes a Generator to return a Problem with the given detail.
WithDetailf customizes a Generator to return a Problem with the formatted detail.
WithDetailKey customizes a Generator to return a Problem with detail localized using the given translation key.
WithDetailKeyOrElse is a convenient shorthand for using both WithDetailKey and WithDetail.
WithExtension customizes a Generator to return a Problem containing the given extension key and value.
WithExtensions customizes a Generator to return a Problem with a shallow clone of the given extensions.
WithInstance customizes a Generator to return a Problem with the given instance URI reference.
WithInstancef customizes a Generator to return a Problem with the formatted instance URI reference.
WithLogLevel customizes a Generator to return a Problem with the given LogLevel.
WithStack customizes a Generator to control if/how a captured stack trace is visible on a Problem.
WithStackFramesSkipped customizes a Generator to skip the given number of additional frames if/when a stack trace is captured.
WithStatus customizes a Generator to return a Problem with the given status.
WithTitle customizes a Generator to return a Problem with the given title.
WithTitlef customizes a Generator to return a Problem with the formatted title.
WithTitleKey customizes a Generator to return a Problem with title localized using the given translation key.
WithTitleKeyOrElse is a convenient shorthand for using both WithTitleKey and WithTitle.
WithType customizes a Generator to return a Problem with the given type URI reference.
WithTypef customizes a Generator to return a Problem with the formatted type URI reference.
WithUUID customizes a Generator to control if/how a generated UUID is visible on a Problem.
Wrap customizes a Generator to return a Problem wrapping the given error.
WriteError is a convenient shorthand for calling Generator.WriteError on the Generator within the given HTTP request's context.Context, if any, otherwise DefaultGenerator.
WriteErrorJSON is a convenient shorthand for calling Generator.WriteErrorJSON on the Generator within the given HTTP request's context.Context, if any, otherwise DefaultGenerator.
WriteErrorXML is a convenient shorthand for calling Generator.WriteErrorXML on the Generator within the given HTTP request's context.Context, if any, otherwise DefaultGenerator.
WriteProblem is a convenient shorthand for calling Generator.WriteProblem on the Generator within the given HTTP request's context.Context, if any, otherwise DefaultGenerator.
WriteProblemJSON is a convenient shorthand for calling Generator.WriteProblemJSON on the Generator within the given HTTP request's context.Context, if any, otherwise DefaultGenerator.
WriteProblemXML is a convenient shorthand for calling Generator.WriteProblemXML on the Generator within the given HTTP request's context.Context, if any, otherwise DefaultGenerator.