redact

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bytes

func Bytes(b []byte) ([]byte, error)

Bytes is a convenience wrapper over String. It returns the original slice on the no-op path.

func ForceInitError

func ForceInitError(forcedErr error) (cleanup func())

ForceInitError makes subsequent String and Bytes calls fail until the returned cleanup function restores the default detector factory.

func SanitizeURL

func SanitizeURL(rawURL string) string

SanitizeURL strips embedded credentials (userinfo), query strings, and fragments from a URL while preserving the scheme, host, and path for identity matching. Non-URL strings and SSH-style URLs pass through unchanged.

func String

func String(s string) (string, error)

String redacts detected secrets in s and returns the original string when no findings are present.

Types

This section is empty.

Jump to

Keyboard shortcuts

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