Documentation
¶
Index ¶
- func SetMasker(masker *masker.Masker)
- func TypeFilter(t interface{}, maskTypes ...masker.MType) *typeFilter
- type Filter
- func FieldFilter(fieldName string, maskTypes ...masker.MType) Filter
- func FieldPrefixFilter(prefix string, maskTypes ...masker.MType) Filter
- func RegexFilter(regexPattern string, maskTypes ...masker.MType) Filter
- func TagFilter(tags ...masker.MType) Filter
- func TagsFilter() Filter
- func ValueFilter(target string, maskTypes ...masker.MType) Filter
- type Filters
- type Masking
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TypeFilter ¶
TypeFilter returns Type Filter with custom masking type.
Types ¶
type Filter ¶
type Filter interface { // ReplaceString is called when checking string type. // The argument is the value to be checked, and the return value should be the value to be replaced. // If nothing needs to be done, the method should return the argument as is. // This method is intended for the case where you want to hide a part of a string. ReplaceString(s string) string // MaskString is called when checking field, prefix type and tag type. // The return value is to be replaced. // This method is intended for the case where you want to hide a part of a string. MaskString(s string) string // ShouldMask is called for all values to be checked. // The field name of the value to be checked, and tag value if the structure has `zlog` tag will be passed as arguments. // If the return value is false, nothing is done; if it is true, the entire field is hidden. // Hidden values will be replaced with the value "[filtered]" if string type. ShouldMask(fieldName string, value interface{}, tag string) bool }
func FieldFilter ¶
FieldFilter returns a Field Filter.
func FieldPrefixFilter ¶
FieldPrefixFilter returns a Field Prefix Filter.
func RegexFilter ¶
RegexFilter returns a Regex Filter.
func TagsFilter ¶
func TagsFilter() Filter
TagsFilter returns a new filter instance with all available maskers
Source Files
¶
Click to show internal directories.
Click to hide internal directories.