redact

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 3 Imported by: 0 modules, 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

Overview

Package redact removes credentials and control characters from text that leaves the gateway (API error messages, logs).

Index

Constants

View Source
const Placeholder = "[redacted]"

Placeholder replaces every secret.

Variables

This section is empty.

Functions

func Message

func Message(text string, limit int) string

Message redacts secrets, strips control characters (except newline and tab), trims and truncates text to at most limit bytes on a UTF-8 boundary. A limit <= 0 means no limit.

func Secrets

func Secrets(text string) string

Secrets replaces known credential formats with Placeholder.

func Truncate

func Truncate(text string, limit int) string

Truncate cuts text to at most limit bytes without splitting a UTF-8 sequence.

Types

This section is empty.

Jump to

Keyboard shortcuts

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