redaction

package
v0.2.0-rc.5-linux-arm64 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Any

func Any(value any, redact func(string) string) any

Any redacts supported JSON-shaped values and returns redacted copies for maps and slices.

func AnyMap

func AnyMap(values map[string]any, redact func(string) string)

AnyMap redacts JSON-shaped map keys and values in place.

func AnyMapCopy

func AnyMapCopy(values map[string]any, redact func(string) string) map[string]any

AnyMapCopy returns a redacted JSON-shaped map without mutating the input map.

func AnySlice

func AnySlice(values []any, redact func(string) string)

AnySlice redacts JSON-shaped slice elements in place.

func ErrorMessage

func ErrorMessage(err error, sensitiveValues ...string) string

ErrorMessage redacts known credentials without unwrapping already-redacted errors. Callers must supply opaque secret values that cannot be recognized by their shape.

func RawJSON

func RawJSON(raw json.RawMessage, redact func(string) string) json.RawMessage

RawJSON decodes, redacts, and re-encodes JSON while falling back to whole-string redaction.

func StringMap

func StringMap(values map[string]string, redact func(string) string)

StringMap redacts string map keys and values in place.

func StringMapCopy

func StringMapCopy(values map[string]string, redact func(string) string) map[string]string

StringMapCopy returns a redacted string map without mutating the input map.

func StringSlice

func StringSlice(values []string, redact func(string) string)

StringSlice redacts every string element in place.

func StringSliceCopy

func StringSliceCopy(values []string, redact func(string) string) []string

StringSliceCopy returns a redacted string slice without mutating the input slice.

Types

This section is empty.

Jump to

Keyboard shortcuts

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