Versions in this module Expand all Collapse all v0 v0.0.0 Oct 23, 2026 Changes in this version + const Redacted + func NewRequestID() (string, error) + func RedactText(text string, secrets ...Secret) string + func StatusCode(err error) int + func StrictJSON[T any](body io.Reader, maxBytes int64, next func(T) error) error + func WriteError(w http.ResponseWriter, requestID string, err error) + type APIError struct + func NewDetailedError(kind ErrorKind, cause error, details ...string) *APIError + func NewError(kind ErrorKind, cause error) *APIError + func (e *APIError) Error() string + func (e *APIError) Unwrap() error + type ErrorKind string + const KindBadGateway + const KindBadRequest + const KindBodyTooLarge + const KindConflict + const KindForbidden + const KindGatewayTimeout + const KindInternal + const KindInvalidRequest + const KindNotFound + const KindRateLimitCapacity + const KindRateLimited + const KindUnauthenticated + const KindUnavailable + type ErrorResponse struct + Error string + Errors []string + func ErrorBody(err error) ErrorResponse + type Secret struct + func NewSecret(value string) Secret + func (Secret) GoString() string + func (Secret) LogValue() slog.Value + func (Secret) MarshalJSON() ([]byte, error) + func (Secret) String() string + func (s Secret) Value() string