Help us shape the future of Go! Take the 2026 Go Developer Survey

safedetails

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

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.

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.

The annotated strings are not visible in the resulting error's main message rechable via Error().

Types

type SafeMessager

type SafeMessager interface {
	SafeMessage() string
}

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

func Safe

func Safe(v interface{}) SafeMessager

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.

Jump to

Keyboard shortcuts

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