Documentation
¶
Index ¶
Constants ¶
View Source
const REDACTED = "REDACTED"
REDACTED is the value that replaces sensitive values.
Variables ¶
This section is empty.
Functions ¶
func Redact ¶
func Redact(obj map[string]any, opts ...RedactOption)
Redact walks obj and replaces values of sensitive keys with a redacted placeholder. It mutates obj in place; nested maps and slice elements are modified directly and no copy is returned.
Types ¶
type RedactOption ¶
type RedactOption func(ro *redactOptions)
RedactOption is an optional arg to control how the Redact method works.
func WithErrorOutput ¶
func WithErrorOutput(w io.Writer) RedactOption
WithErrorOutput determines where any error messages that are encountered are written to.
Defaults to io.Discard.
func WithIgnoreKeys ¶
func WithIgnoreKeys(keys ...string) RedactOption
WithIgnoreKeys sets case-sensitive key values where redaction will be skipped.
func WithMarkerPrefix ¶
func WithMarkerPrefix(s string) RedactOption
WithMarkerPrefix sets the redaction marker prefix string.
Click to show internal directories.
Click to hide internal directories.