redact

package
v0.92.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 15 Imported by: 11

Documentation

Index

Constants

View Source
const (
	MASK_TEXT = "***HIDDEN***"
)

Variables

View Source
var NEW_LINE = []byte{'\n'}

Functions

func Redact

func Redact(input io.Reader, path string, additionalRedactors []*troubleshootv1beta2.Redact) (io.Reader, error)

func ResetRedactionList added in v0.9.34

func ResetRedactionList()

Types

type LineRedactor added in v0.71.0

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

type MultiLineRedactor

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

func NewMultiLineRedactor

func NewMultiLineRedactor(re1 LineRedactor, re2 string, maskText, path, name string, isDefault bool) (*MultiLineRedactor, error)

func (*MultiLineRedactor) Redact

func (r *MultiLineRedactor) Redact(input io.Reader, path string) io.Reader

type Redaction added in v0.9.34

type Redaction struct {
	RedactorName      string `json:"redactorName" yaml:"redactorName"`
	CharactersRemoved int    `json:"charactersRemoved" yaml:"charactersRemoved"`
	Line              int    `json:"line" yaml:"line"`
	File              string `json:"file" yaml:"file"`
	IsDefaultRedactor bool   `json:"isDefaultRedactor" yaml:"isDefaultRedactor"`
}

type RedactionList added in v0.9.34

type RedactionList struct {
	ByRedactor map[string][]Redaction `json:"byRedactor" yaml:"byRedactor"`
	ByFile     map[string][]Redaction `json:"byFile" yaml:"byFile"`
}

Redactions are indexed both by the file affected and by the name of the redactor

func GetRedactionList added in v0.9.34

func GetRedactionList() RedactionList

type Redactor

type Redactor interface {
	Redact(input io.Reader, path string) io.Reader
}

type SingleLineRedactor

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

func NewSingleLineRedactor

func NewSingleLineRedactor(re LineRedactor, maskText, path, name string, isDefault bool) (*SingleLineRedactor, error)

func (*SingleLineRedactor) Redact

func (r *SingleLineRedactor) Redact(input io.Reader, path string) io.Reader

type YamlRedactor added in v0.9.31

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

func NewYamlRedactor added in v0.9.31

func NewYamlRedactor(yamlPath, filePath, name string) *YamlRedactor

func (*YamlRedactor) Redact added in v0.9.31

func (r *YamlRedactor) Redact(input io.Reader, path string) io.Reader

Jump to

Keyboard shortcuts

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