Documentation
¶
Overview ¶
Package redact provides redaction of sensitive information from strings or streams.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Redacter ¶
Redacter is implemented by types that can redact sensitive information from a string.
func StringRedacter ¶
StringRedacter returns a Redacter that performs best-effort redaction of the provided match strings using the provided mask. Redaction is not guaranteed to be complete in all cases:
- Matches where the mask contains the match string are silently dropped (replacing would immediately reintroduce the secret).
- When the mask is longer than the match, only a single replacement pass is made; a replacement can re-introduce the match at a boundary (e.g. match="ab", mask="xxa", input="abb" → "xxab"), leaving a residual occurrence.
Callers must not rely on this for guaranteed removal of sensitive data. It is intended for best-effort log redaction.
Click to show internal directories.
Click to hide internal directories.