Documentation
¶
Overview ¶
Package redaction provides utilities for redacting sensitive information in logs, error messages, and other outputs to protect privacy and comply with data protection regulations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Redact ¶
Redact redacts sensitive information for logging and output purposes. Shows the first 3 characters when the string has more than 5 characters, otherwise shows asterisks for shorter strings.
Examples:
- Redact("") → ""
- Redact("ab") → "**"
- Redact("abc") → "a****"
- Redact("johndoe123") → "joh****"
func RedactEmail ¶
RedactEmail redacts email addresses for logging and output purposes. Shows the first 3 characters of the local part and keeps the full domain visible for debugging purposes.
Examples:
- RedactEmail("") → ""
- RedactEmail("a@example.com") → "**@example.com"
- RedactEmail("john@example.com") → "j****@example.com"
- RedactEmail("johndoe@company.com") → "joh****@company.com"
- RedactEmail("invalid-email") → "inv****" (falls back to Redact)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.