Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ClearFieldFunc = func(message protoreflect.Message, fieldDescriptor protoreflect.FieldDescriptor) error { message.Clear(fieldDescriptor) return nil } ClearMapFunc = func(valueMap protoreflect.Map, mapKey protoreflect.MapKey, _ protoreflect.Value) error { valueMap.Clear(mapKey) return nil } ClearListFunc = func(list protoreflect.List) error { list.Truncate(0) return nil } CommonFieldsFromMapFunc = func(ext any) map[string]struct{} { extNeeded, ok := ext.(interface { GetMapKeysToRedact() []string }) if !ok || len(extNeeded.GetMapKeysToRedact()) == 0 { return nil } return lilith.ArrayToMapValues(extNeeded.GetMapKeysToRedact()) } )
View Source
var (
ErrInvalidRedactorArgs = errors.New("invalid args")
)
Functions ¶
This section is empty.
Types ¶
type FieldsFromMapFunc ¶
type RedactFieldFunc ¶
type RedactFieldFunc func(message protoreflect.Message, fd protoreflect.FieldDescriptor) error
type RedactListFunc ¶
type RedactListFunc func(list protoreflect.List) error
type RedactMapFunc ¶
type RedactMapFunc func(valueMap protoreflect.Map, mapKey protoreflect.MapKey, value protoreflect.Value) error
type Redactor ¶
type Redactor struct {
// contains filtered or unexported fields
}
func NewClearRedactor ¶
func NewClearRedactor(extInfo *protoimpl.ExtensionInfo, opts ...RedactorOption) (*Redactor, error)
func NewRedactor ¶
func NewRedactor( extInfo *protoimpl.ExtensionInfo, opts ...RedactorOption, ) (*Redactor, error)
type RedactorFuncs ¶
type RedactorFuncs struct {
// contains filtered or unexported fields
}
type RedactorOption ¶
type RedactorOption func(*Redactor)
func WithFieldsFromMapFunc ¶
func WithFieldsFromMapFunc(fieldsFromMapFunc FieldsFromMapFunc) RedactorOption
func WithRedactFuncs ¶
func WithRedactFuncs(redactFuncs ...RedactFieldFunc) RedactorOption
func WithRedactListFuncs ¶
func WithRedactListFuncs(redactListFuncs ...RedactListFunc) RedactorOption
func WithRedactMapFuncs ¶
func WithRedactMapFuncs(redactMapFuncs ...RedactMapFunc) RedactorOption
Click to show internal directories.
Click to hide internal directories.