Documentation
¶
Overview ¶
Package mask hides sensitive values, for logs and other output.
Index ¶
- func Full[S ~string](S) S
- func Hash[S ~string](s S) S
- func LogValue(v any) slog.Value
- func Map[T interface{ ... }](m map[string]T) map[string]T
- func Partial[S ~string](s S, prefix, suffix int) S
- func Regex[S ~string](s S, re *regexp.Regexp) S
- func Slice[T interface{ ... }](s []T) []T
- func Zero[T any](T) T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Hash ¶
func Hash[S ~string](s S) S
Hash replaces s with the start of its SHA-256 in hex, so equal values stay equal in logs.
func LogValue ¶
LogValue gives slog the JSON of v: an object is a group with its keys in order, an array a list, anything else its value. A value without JSON gives the error text.
func Partial ¶
Partial keeps prefix characters at the start of s and suffix at the end, and masks the rest. A value too short to hide anything is masked in full.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.