redact

package
v0.13.10 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2021 License: Apache-2.0 Imports: 13 Imported by: 12

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func Redact

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

func ResetRedactionList added in v0.9.34

func ResetRedactionList()

Types

type MultiLineRedactor

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

func NewMultiLineRedactor

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

func (*MultiLineRedactor) Redact

func (r *MultiLineRedactor) Redact(input io.Reader) 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) io.Reader
}

type SingleLineRedactor

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

func NewSingleLineRedactor

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

func (*SingleLineRedactor) Redact

func (r *SingleLineRedactor) Redact(input io.Reader) 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) io.Reader

Jump to

Keyboard shortcuts

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