redact

package
v2.0.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package redact provides redaction of sensitive information from strings or streams.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Reader

func Reader(r io.Reader, mask string, matches ...string) io.Reader

Reader returns a new io.Reader that will redact any matches of the provided strings with the provided mask.

func Writer

func Writer(w io.Writer, mask string, matches ...string) io.WriteCloser

Writer returns an io.WriteCloser that writes to w, redacting any matches of the given patterns with the given mask.

Types

type Redacter

type Redacter interface {
	Redact(input string) string
}

Redacter is implemented by types that can redact sensitive information from a string.

func StringRedacter

func StringRedacter(mask string, matches ...string) Redacter

StringRedacter returns a Redacter that will redact any matches of the provided strings with the provided mask.

Jump to

Keyboard shortcuts

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