redactwriter

package
v2.0.0-alpha.21 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: MIT Imports: 7 Imported by: 7

Documentation

Index

Constants

View Source
const RedactStr = "[REDACTED]"

RedactStr ...

Variables

This section is empty.

Functions

This section is empty.

Types

type Writer

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

Writer ...

func New

func New(secrets []string, target io.Writer, logger log.Logger) *Writer

New ...

func (*Writer) Close

func (w *Writer) Close() error

Close implements io.Writer interface

func (*Writer) Write

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

Write implements io.Writer interface. Splits p into lines, the lines are matched against the secrets, this determines which lines can be redacted and passed to the next writer (target). There might be lines that need to be buffered since they partially match a secret. We do not know the last Write call, so Close needs to be called to flush the buffer.

Jump to

Keyboard shortcuts

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