# README
redact
Utilities to redact Go strings for confidentiality
Some explanations about how this is used in e.g. CockroachDB:
https://wiki.crdb.io/wiki/spaces/CRDB/pages/1824817806/Log+and+error+redactability
# Functions
EndMarker returns the end delimiter for an unsafe string.
EscapeBytes escapes markers inside the given byte slice and encloses the entire byte slice between redaction markers.
EscapeMarkers escapes the special delimiters from the provided byte slice.
Fprint is like Sprint but outputs the redactable string to the provided Writer.
Fprintf is like Sprintf but outputs the redactable string to the provided Writer.
HelperForErrorf is a helper to implement a redaction-aware fmt.Errorf-compatible function in a different package.
Join creates a redactable string from the given slice of redactable strings, adjoined with the provided delimiter.
JoinTo writes the given slice of values delimited by the provided delimiter to the given SafeWriter.
MakeFormat is a helper for use by implementations of the SafeFormatter interface.
RedactedMarker returns the special string used by Redact.
RegisterRedactErrorFn registers an error redaction function for use during automatic redaction by this package.
RegisterSafeType registers a data type to always be considered safe during the production of redactable strings.
Safe turns any value into an object that is considered as safe by the formatter.
SortStrings sorts the provided slice of redactable strings.
Sprint prints out the arguments and encloses unsafe bits between redaction markers.
Sprintf formats the arguments and encloses unsafe bits between redaction markers.
Sprintfn produces a RedactableString using the provided SafeFormat-alike function.
StartMarker returns the start delimiter for an unsafe string.
StringWithoutMarkers formats the provided SafeFormatter and strips the redaction markers from the result.
Unsafe turns any value that would otherwise be considered safe, into an unsafe value.
# Type aliases
ManualBuffer is a variable-sized buffer of bytes with Write methods.
RedactableBytes is like RedactableString but is a byte slice.
RedactableString is a string that contains a mix of safe and unsafe bits of data, but where it is known that unsafe bits are enclosed by redaction markers ‹ and ›, and occurrences of the markers inside the original data items have been escaped.
SafeFloat represents a floating-point value that is not a sensitive value.
SafeFormatter is implemented by object types that want to separate safe and non-safe information when printed out by a Printf-like formatter.
SafeInt represents an integer that is not a sensitive value.
SafeMessager is an alternative to SafeFormatter used in previous versions of CockroachDB.
SafePrinter is a stateful helper that abstracts an output stream in the context of printf-like formatting, but with the ability to separate safe and unsafe bits of data.
SafeRune aliases rune.
SafeString represents a string that is not a sensitive value.
SafeUint represents an integer that is not a sensitive value.
SafeValue is a marker interface to be implemented by types that alias base Go types and whose natural representation via Printf is always safe for reporting.
SafeWriter provides helper functions for use in implementations of SafeFormatter, to format mixes of safe and unsafe strings.
StringBuilder accumulates strings with optional redaction markers.