MCPcopy Create free account
hub / github.com/cockroachdb/redact / SafeWriter

Interface SafeWriter

interfaces/interfaces.go:52–96  ·  view source on GitHub ↗

SafeWriter provides helper functions for use in implementations of SafeFormatter, to format mixes of safe and unsafe strings.

Source from the content-addressed store, hash-verified

50// SafeWriter provides helper functions for use in implementations of
51// SafeFormatter, to format mixes of safe and unsafe strings.
52type SafeWriter interface {
53 // SafeString emits a safe string.
54 SafeString(SafeString)
55
56 // SafeInt emits a safe integer.
57 SafeInt(SafeInt)
58
59 // SafeUint emits a safe unsigned integer.
60 SafeUint(SafeUint)
61
62 // SafeFloat emits a safe floating-point value.
63 SafeFloat(SafeFloat)
64
65 // SafeRune emits a safe rune.
66 SafeRune(SafeRune)
67
68 // SafeByte emits a safe byte.
69 SafeByte(SafeByte)
70
71 // SafeBytes emits a safe byte slice.
72 SafeBytes(SafeBytes)
73
74 // Print emits its arguments separated by spaces.
75 // For each argument it dynamically checks for the SafeFormatter or
76 // SafeValue interface and either use that, or mark the argument
77 // payload as unsafe.
78 Print(args ...interface{})
79
80 // For printf, a linter checks that the format string is
81 // a constant literal, so the implementation can assume it's always
82 // safe.
83 Printf(format string, arg ...interface{})
84
85 // UnsafeString writes an unsafe string.
86 UnsafeString(string)
87
88 // UnsafeByte writes an unsafe byte.
89 UnsafeByte(byte)
90
91 // UnsafeBytes writes an unsafe byte slice.
92 UnsafeBytes([]byte)
93
94 // UnsafeRune writes an unsafe rune.
95 UnsafeRune(rune)
96}
97
98// SafeString represents a string that is not a sensitive value.
99type SafeString string

Callers 21

TestPrinterFunction · 0.65
TestPrinterFunction · 0.65
TestPrinterFunction · 0.65
TestPrinterFunction · 0.65
TestPrinterFunction · 0.65
TestPrinterSpaceOmissionFunction · 0.65
TestPrinterFunction · 0.65
TestPrinterSpaceOmissionFunction · 0.65
JoinToFunction · 0.65
SafeFormatMethod · 0.65
SafeFormatMethod · 0.65
SafeFormatMethod · 0.65

Implementers 2

ppinternal/rfmt/print.go
StringBuilderbuilder/builder.go

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…