Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/cockroachdb/redact
/ functions
Functions
332 in github.com/cockroachdb/redact
⨍
Functions
332
◇
Types & classes
70
↓ 80 callers
Method
Printf
For printf, a linter checks that the format string is a constant literal, so the implementation can assume it's always safe.
interfaces/interfaces.go:83
↓ 65 callers
Method
checkInvariants
(t *testing.T)
internal/buffer/buffer_test.go:25
↓ 60 callers
Method
checkEqual
(t *testing.T, expected string)
internal/buffer/buffer_test.go:59
↓ 58 callers
Method
restore
()
internal/rfmt/helpers.go:79
↓ 49 callers
Method
writeString
(s string)
internal/rfmt/print.go:95
↓ 48 callers
Method
SetMode
SetMode changes the output mode.
internal/buffer/buffer.go:259
↓ 47 callers
Function
Sprintf
Sprintf formats the arguments and encloses unsafe bits between redaction markers. If either safe and unsafe bits of data contain the markers in their
markers_print.go:40
↓ 47 callers
Method
WriteByte
WriteByte emits a single byte.
internal/buffer/buffer.go:153
↓ 38 callers
Method
writeByte
(c byte)
internal/rfmt/print.go:99
↓ 37 callers
Method
WriteString
WriteString appends the contents of s to the buffer, growing the buffer as needed. The return value n is the length of s; err is always nil. If the bu
internal/buffer/buffer.go:143
↓ 36 callers
Method
Print
Print emits its arguments separated by spaces. For each argument it dynamically checks for the SafeFormatter or SafeValue interface and either use tha
interfaces/interfaces.go:78
↓ 33 callers
Method
startUnsafe
()
internal/rfmt/helpers.go:37
↓ 32 callers
Method
Redact
Redact replaces all occurrences of unsafe substrings by the "Redacted" marker, ‹×›. Hash markers (‹†value›) are replaced with hashed values (‹hash›) i
internal/markers/markers.go:89
↓ 30 callers
Function
Safe
Safe turns any value into an object that is considered as safe by the formatter. This is provided as an “escape hatch” for cases where the other inte
api.go:168
↓ 24 callers
Method
WriteRune
WriteRune emits a single rune.
internal/buffer/buffer.go:171
↓ 23 callers
Function
DisableHashing
DisableHashing disables hash-based redaction. Hash markers will be fully redacted instead of being replaced with hashes.
api.go:213
↓ 23 callers
Function
EnableHashing
EnableHashing enables hash-based redaction with an optional salt. Hash markers (‹†value›) will be replaced with hashes instead of being fully redacted
api.go:207
↓ 22 callers
Method
String
()
internal/rfmt/print.go:75
↓ 22 callers
Method
resetWithMode
(mode OutputMode)
internal/buffer/buffer_test.go:200
↓ 20 callers
Function
Unsafe
Unsafe turns any value that would otherwise be considered safe, into an unsafe value.
api.go:159
↓ 20 callers
Method
Write
Write appends the contents of p to the buffer, growing the buffer as needed. The return value n is the length of p; err is always nil. If the buffer b
internal/buffer/buffer.go:131
↓ 18 callers
Method
fmtInteger
fmtInteger formats a signed or unsigned integer.
internal/rfmt/print.go:380
↓ 16 callers
Method
startSafeOverride
()
internal/rfmt/helpers.go:53
↓ 15 callers
Method
RedactableString
RedactableString returns the bytes in the buffer.
internal/buffer/buffer.go:70
↓ 14 callers
Method
Reset
Reset resets the buffer to be empty, but it retains the underlying storage for use by future writes. It also resets the output mode to UnsafeEscaped.
internal/buffer/buffer.go:277
↓ 13 callers
Method
StripMarkers
StripMarkers removes the redaction markers from the RedactableBytes. This returns an unsafe string where all safe and unsafe bits are mixed together.
internal/markers/markers.go:81
↓ 13 callers
Method
Write
Write is the function to call to emit formatted output to be printed.
internal/rfmt/print.go:51
↓ 11 callers
Method
pad
pad appends b to f.buf, padded on left (!f.minus) or right (f.minus).
internal/rfmt/format.go:85
↓ 10 callers
Method
SafeRune
SafeRune is part of the SafeWriter interface.
builder/builder.go:128
↓ 10 callers
Method
WriteString
Implement WriteString so that we can call io.WriteString on a pp (through state), for efficiency.
internal/rfmt/print.go:200
↓ 10 callers
Method
badVerb
(verb rune)
internal/rfmt/print.go:338
↓ 10 callers
Method
free
free saves used pp structs in ppFree; avoids an allocation per invocation.
internal/rfmt/print.go:152
↓ 10 callers
Function
newPrinter
newPrinter allocates a new pp struct or grabs a cached one.
internal/rfmt/print.go:142
↓ 9 callers
Method
SafeRune
SafeRune emits a safe rune.
interfaces/interfaces.go:66
↓ 9 callers
Function
Sprint
Sprint prints out the arguments and encloses unsafe bits between redaction markers. If either safe and unsafe bits of data contain the markers in thei
markers_print.go:29
↓ 9 callers
Method
writePadding
writePadding generates n bytes of padding.
internal/rfmt/format.go:67
↓ 7 callers
Method
GetMode
GetMode retrieves the output mode.
internal/buffer/buffer.go:254
↓ 7 callers
Method
SafeString
SafeString is part of the SafeWriter interface.
builder/builder.go:104
↓ 7 callers
Function
appendHash
appendHash computes a truncated hash of value and appends the hex result directly to dst, avoiding an intermediate allocation. Must only be called whe
internal/markers/hash.go:113
↓ 7 callers
Method
catchPanic
(arg interface{}, verb rune, method string)
internal/rfmt/print.go:572
↓ 7 callers
Method
finalize
finalize ensures that all the buffer is properly marked.
internal/buffer/buffer.go:184
↓ 7 callers
Method
fmtFloat
fmtFloat formats a float. The default precision for each verb is specified as last argument in the call to fmt_float.
internal/rfmt/print.go:420
↓ 7 callers
Method
grow
grow grows the buffer to guarantee space for n more bytes. It returns the index where bytes should be written. If the buffer can't grow it will panic
internal/buffer/buffer.go:298
↓ 7 callers
Method
printArg
(arg interface{}, verb rune)
internal/rfmt/print.go:699
↓ 7 callers
Method
tryGrowByReslice
tryGrowByReslice is a inlineable version of grow for the fast-case where the internal buffer only needs to be resliced. It returns the index where byt
internal/buffer/buffer.go:287
↓ 6 callers
Method
Len
()
internal/rfmt/fmtsort/sort.go:28
↓ 6 callers
Method
padString
padString appends s to f.buf, padded on left (!f.minus) or right (f.minus).
internal/rfmt/format.go:103
↓ 6 callers
Method
printValue
printValue is similar to printArg but starts with a reflect value, not an interface{} value. It does not handle 'p' and 'T' verbs because these should
internal/rfmt/print.go:825
↓ 5 callers
Method
Flag
Flag reports whether the flag c, a character, has been set.
internal/rfmt/print.go:58
↓ 5 callers
Method
RedactableBytes
RedactableBytes returns the bytes in the buffer.
internal/buffer/buffer.go:61
↓ 5 callers
Method
TakeRedactableString
TakeRedactableString returns the buffer contents and reinitializes the buffer. This saves a memory allocation compared to RedactableString().
internal/buffer/buffer.go:102
↓ 5 callers
Method
fmt0x64
fmt0x64 formats a uint64 in hexadecimal and prefixes it with 0x or not, as requested, by temporarily setting the sharp flag.
internal/rfmt/print.go:371
↓ 5 callers
Method
fmtString
(v string, verb rune)
internal/rfmt/print.go:460
↓ 5 callers
Method
write
(p []byte)
internal/rfmt/print.go:91
↓ 4 callers
Function
DisableHashing
DisableHashing disables hash-based redaction. The pool and salt are intentionally left intact so that in-flight hashers (which captured the pool point
internal/markers/hash.go:101
↓ 4 callers
Function
EnableHashing
EnableHashing enables hash-based redaction with an optional salt. When salt is nil, hash markers use plain SHA-256. When salt is provided, hash marker
internal/markers/hash.go:75
↓ 4 callers
Method
Len
()
util.go:60
↓ 4 callers
Function
Sprint
Sprint formats using the default formats for its operands and returns the resulting string. Spaces are added between operands when neither is a string
internal/rfmt/print.go:255
↓ 4 callers
Method
WriteByte
WriteByte shadows the ib.Buffer.WriteByte method.
builder/builder.go:77
↓ 4 callers
Method
WriteRune
WriteRune shadows the ib.Buffer.WriteRune method.
builder/builder.go:83
↓ 4 callers
Method
WriteString
WriteString shadows the ib.Buffer.WriteString method.
builder/builder.go:71
↓ 4 callers
Method
clearflags
()
internal/rfmt/format.go:57
↓ 4 callers
Method
doPrintf
(format string, a []interface{})
internal/rfmt/print.go:1098
↓ 4 callers
Method
fmtComplex
fmtComplex formats a complex number v with r = real(v) and j = imag(v) as (r+ji) using fmtFloat for r and j formatting.
internal/rfmt/print.go:442
↓ 4 callers
Method
fmtS
fmtS formats a string.
internal/rfmt/format.go:352
↓ 4 callers
Function
makeMixedInts
()
markers_test.go:696
↓ 4 callers
Method
startPreRedactable
()
internal/rfmt/helpers.go:45
↓ 4 callers
Method
startWrite
()
internal/buffer/buffer.go:214
↓ 4 callers
Method
writeRune
(r rune)
internal/rfmt/print.go:103
↓ 3 callers
Function
InternalEscapeBytes
InternalEscapeBytes escapes redaction markers in the provided buf starting at the location startLoc. The bytes before startLoc are considered safe (al
internal/escape/escape.go:34
↓ 3 callers
Method
Printf
Printf is part of the SafeWriter interface.
builder/builder.go:98
↓ 3 callers
Method
SafeString
SafeString emits a safe string.
interfaces/interfaces.go:54
↓ 3 callers
Method
TakeRedactableBytes
TakeRedactableBytes returns the buffer contents and reinitializes the buffer. This saves a memory allocation compared to RedactableBytes().
internal/buffer/buffer.go:90
↓ 3 callers
Method
ToBytes
ToBytes converts the string to a byte slice.
internal/markers/markers.go:60
↓ 3 callers
Method
UnsafeRune
UnsafeRune writes an unsafe rune.
interfaces/interfaces.go:95
↓ 3 callers
Method
argNumber
argNumber returns the next argument to evaluate, which is either the value of the passed-in argNum or the value of the bracketed integer that begins f
internal/rfmt/print.go:1071
↓ 3 callers
Method
doPrint
(a []interface{})
internal/rfmt/print.go:1274
↓ 3 callers
Function
floatCompare
floatCompare compares two floating-point values. NaNs compare low.
internal/rfmt/fmtsort/sort.go:206
↓ 3 callers
Method
fmtQ
fmtQ formats a string as a double-quoted, escaped Go string constant. If f.sharp is set a raw (backquoted) string may be returned instead if the strin
internal/rfmt/format.go:443
↓ 3 callers
Method
handleMethods
(verb rune)
internal/rfmt/print.go:606
↓ 3 callers
Function
parsenum
parsenum converts ASCII to integer. num is 0 (and isnum is false) if no number present.
internal/rfmt/print.go:314
↓ 3 callers
Method
startHashRedactable
()
internal/rfmt/helpers.go:100
↓ 3 callers
Function
stripMarkersBytes
stripMarkersBytes scans data for marker characters (‹, ›, †) and either removes them (when replacement is nil) or replaces them with the replacement b
internal/markers/markers.go:178
↓ 2 callers
Function
EscapeMarkers
EscapeMarkers escapes the special delimiters from the provided byte slice.
internal/markers/markers.go:156
↓ 2 callers
Function
Fprint
These routines do not take a format string Fprint formats using the default formats for its operands and writes to w. Spaces are added between operand
internal/rfmt/print.go:238
↓ 2 callers
Function
Fprintf
Fprintf is like Sprintf but outputs the redactable string to the provided Writer.
markers_print.go:85
↓ 2 callers
Function
Fprintf
These routines end in 'f' and take a format string. Fprintf formats according to a format specifier and writes to w. It returns the number of bytes wr
internal/rfmt/print.go:210
↓ 2 callers
Method
GetValue
()
internal/redact/wrappers.go:40
↓ 2 callers
Function
HelperForErrorf
HelperForErrorf is a helper to implement a redaction-aware fmt.Errorf-compatible function in a different package. It formats the string according to t
markers_print.go:53
↓ 2 callers
Function
JoinTo
JoinTo writes the given slice of values delimited by the provided delimiter to the given SafeWriter.
util.go:26
↓ 2 callers
Function
MakeFormat
MakeFormat reproduces the format currently active in fmt.State and verb. This is provided because Go's standard fmt.State does not make the original f
internal/fmtforward/make_format.go:45
↓ 2 callers
Method
Print
Print is part of the SafeWriter interface.
builder/builder.go:92
↓ 2 callers
Function
ReproducePrintf
ReproducePrintf calls fmt.Print/fmt.Printf on the argument based on the details present in the fmt.State and writes to the io.Writer.
internal/fmtforward/make_format.go:27
↓ 2 callers
Method
SafeByte
(s i.SafeByte)
builder/builder.go:133
↓ 2 callers
Method
UnsafeByte
UnsafeByte writes an unsafe byte.
interfaces/interfaces.go:89
↓ 2 callers
Method
UnsafeByte
UnsafeByte is part of the SafeWriter interface.
builder/builder.go:156
↓ 2 callers
Method
UnsafeString
UnsafeString writes an unsafe string.
interfaces/interfaces.go:86
↓ 2 callers
Method
UnsafeString
UnsafeString is part of the SafeWriter interface.
builder/builder.go:144
↓ 2 callers
Method
doPrintln
doPrintln is like doPrint but always adds a space between arguments and a newline after the last argument.
internal/rfmt/print.go:1290
↓ 2 callers
Method
endRedactable
endRedactable adds the closing redaction marker.
internal/buffer/buffer.go:197
next →
1–100 of 332, ranked by callers