redact

package
v1.1.0-beta.0...-d13e52e Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeRedact

func DeRedact(remove bool, input io.Reader, output io.Writer, sep string) error

DeRedact is similar to DeRedactFile, but act on reader/writer, it works line by line.

func DeRedactFile

func DeRedactFile(remove bool, input string, output string) error

DeRedactFile will deredact the input file, either removing marked contents, or remove the marker. It works line by line.

func InitRedact

func InitRedact(redactLog bool)

InitRedact inits the enableRedactLog

func Key

func Key(key []byte) string

Key receives a key return omitted information if redact log enabled

func NeedRedact

func NeedRedact() bool

NeedRedact returns whether to redact log

func String

func String(mode string, input string) string

String will redact the input string according to 'mode'. Check 'tidb_redact_log': https://github.com/pingcap/tidb/blob/acf9e3128693a5a13f31027f05f4de41edf8d7b2/pkg/sessionctx/variable/sysvar.go#L2154.

func Stringer

func Stringer(mode string, input fmt.Stringer) redactStringer

Stringer will redact the input stringer according to 'mode', similar to String().

func Value

func Value(arg string) string

Value receives string argument and return omitted information if redact log enabled

func WriteRedact

func WriteRedact(build *strings.Builder, v string, redact string)

WriteRedact is to write string with redact into `strings.Builder`

Types

type TaskInfoRedacted

type TaskInfoRedacted struct {
	Info *backup.StreamBackupTaskInfo
}

TaskInfoRedacted is a wrapper of backup.StreamBackupTaskInfo to redact sensitive information

func (TaskInfoRedacted) String

func (t TaskInfoRedacted) String() string

String returns the redacted string of the task info

Jump to

Keyboard shortcuts

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