redact

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResetForTest

func ResetForTest()

ResetForTest clears the error redaction registry. It is intended for tests in other packages that need deterministic state.

func SetSecrets

func SetSecrets(key string, secrets ...string)

SetSecrets associates a set of secrets with the given key. Calling again with the same key replaces the previous secrets, so rotating credentials (e.g. access tokens) are handled naturally without explicit unregistration.

The key should identify the credential scope, e.g. "qq-token:<appID>" or "telegram:<configID>". For multiple instances of the same adapter, include a stable instance identifier in the key.

Callers decide where redaction is appropriate. Logs and normal outbound messages should retain their original text unless their own contract says otherwise.

func Text

func Text(text string) string

Text masks registered secrets in text selected by the caller.

Types

This section is empty.

Jump to

Keyboard shortcuts

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