safedetails

package
v1.11.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 28, 2023 License: Apache-2.0 Imports: 6 Imported by: 16

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Redact

func Redact(r interface{}) string

Redact returns a redacted version of the supplied item that is safe to use in anonymized reporting.

NB: this interface is obsolete. Use redact.Sprint() directly.

func Safe

func Safe(v interface{}) redact.SafeValue

Safe wraps the given object into an opaque struct that implements SafeMessager: its contents can be included as-is in PII-free strings in error objects and reports.

NB: this is obsolete. Use redact.Safe instead.

func WithSafeDetails

func WithSafeDetails(err error, format string, args ...interface{}) error

WithSafeDetails annotates an error with the given reportable details. The format is made available as a PII-free string, alongside with a PII-free representation of every additional argument. Arguments can be reported as-is (without redaction) by wrapping them using the Safe() function.

If the format is empty and there are no arguments, the error argument is returned unchanged.

Detail is shown: - via `errors.GetSafeDetails()` - when formatting with `%+v`. - in Sentry reports.

Types

type SafeMessager

type SafeMessager = redact.SafeMessager

SafeMessager is implemented by objects which have a way of representing themselves suitably redacted for anonymized reporting.

NB: this interface is obsolete. Use redact.SafeFormatter instead.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL