{"modulePath":"github.com/openshift-hyperfleet/hyperfleet-api","version":"v0.4.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package response\n\n## Functions\n\n```go\nfunc WriteProblemDetailsResponse(w http.ResponseWriter, r *http.Request, code int, payload interface{})\n```\nWriteProblemDetailsResponse writes an RFC 9457 Problem Details response\n\n```go\nfunc WriteServiceErrorResponse(ctx context.Context, w http.ResponseWriter, r *http.Request, err *errors.ServiceError)\n```\nWriteServiceErrorResponse writes err as an RFC 9457 Problem Details response, resolving the trace ID from ctx (via logger.GetRequestID) and using the request path as the problem instance. ctx is taken explicitly rather than derived from r.Context() so callers can still resolve a trace ID when r is nil. Callers are responsible for logging the error themselves beforehand, since the appropriate log level (e.g. Warn vs Info vs Error) varies by caller.\n\n","path":"github.com/openshift-hyperfleet/hyperfleet-api/pkg/api/response","name":"response","synopsis":"","isRedistributable":true}
