redaction

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RedactedSecret    = "[REDACTED]"
	CircularReference = "[Circular]"
)

Variables

This section is empty.

Functions

func ErrorMessage

func ErrorMessage(err error, options Options) string

func IsSensitiveKey

func IsSensitiveKey(key string, options Options) bool

func RedactString

func RedactString(value string, options Options) string

func RedactValue

func RedactValue(value any, options Options) any

Types

type Options

type Options struct {
	Replacement        string
	ExtraSensitiveKeys []string
	ExtraSecretValues  []string
	MaxDepth           int
}

type RedactedError

type RedactedError struct {
	Name    string         `json:"name"`
	Message string         `json:"message"`
	Stack   string         `json:"stack,omitempty"`
	Fields  map[string]any `json:"fields,omitempty"`
}

func RedactError

func RedactError(err error, options Options) RedactedError

Jump to

Keyboard shortcuts

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