redact

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: MIT Imports: 5 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 keeps secret values out of every bitc log sink (spec 10).

Index

Constants

View Source
const Placeholder = "<redacted>"

Placeholder replaces every secret.

Variables

This section is empty.

Functions

This section is empty.

Types

type Set

type Set struct {
	// contains filtered or unexported fields
}

Set is the set of secret values to redact. It is safe for concurrent use.

func New

func New() *Set

func (*Set) Add

func (s *Set) Add(secret string)

Add registers a secret; empty strings are ignored.

func (*Set) Contains

func (s *Set) Contains(x string) bool

Contains reports whether any secret occurs in x.

func (*Set) Env

func (s *Set) Env(env []string) []string

Env drops entries whose value contains a secret.

func (*Set) String

func (s *Set) String(x string) string

String replaces every occurrence of every secret.

func (*Set) Writer

func (s *Set) Writer(w io.Writer) *Writer

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

Writer redacts a stream. It writes whole lines as they complete; a line longer than 64 KiB is written in pieces, holding back enough bytes that a secret split across a piece boundary is still caught. Call Flush at the end.

func (*Writer) Flush

func (w *Writer) Flush() error

Flush writes what is pending, redacted.

func (*Writer) Write

func (w *Writer) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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