redact

package
v0.44.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

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.

Jump to

Keyboard shortcuts

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