Documentation
¶
Index ¶
- func DeRedact(remove bool, input io.Reader, output io.Writer, sep string) error
- func DeRedactFile(remove bool, input string, output string) error
- func InitRedact(redactLog bool)
- func Key(key []byte) string
- func LockInfo(lock *kvrpcpb.LockInfo) fmt.Stringer
- func LockInfoWithMode(lock *kvrpcpb.LockInfo, mode string) fmt.Stringer
- func NeedRedact() bool
- func RegionError(regionErr *errorpb.Error) string
- func String(mode string, input string) string
- func Stringer(mode string, input fmt.Stringer) redactStringer
- func Value(arg string) string
- func WriteRedact(build *strings.Builder, v string, redact string)
- type TaskInfoRedacted
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeRedact ¶
DeRedact is similar to DeRedactFile, but act on reader/writer, it works line by line.
func DeRedactFile ¶
DeRedactFile will deredact the input file, either removing marked contents, or remove the marker. It works line by line.
func LockInfo ¶
LockInfo returns a fmt.Stringer of the lock info. The keys in the lock info (primary lock, key, secondaries and the keys of nested shared locks) are replaced by '?' if redact log is enabled. The String() method is evaluated lazily, so it is cheap to pass it to a logger whose level is not enabled.
func LockInfoWithMode ¶
LockInfoWithMode is like LockInfo, but also masks keys when mode is ON or MARKER. Process-global redaction still applies when mode is OFF or empty. All enabled modes replace key bytes with '?', and formatting remains lazy.
func RegionError ¶
RegionError formats a region error without modifying it. When redaction is enabled, keys and the top-level message are masked while internal diagnostic metadata, including nested reasons and messages, is preserved.
func 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.
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