Documentation ¶
Index ¶
- func FixedMaskFunc(s string) string
- func MaskEmailFunc(s string) string
- func MaskPhoneFunc(s string) string
- type MaskedText
- func (m MaskedText) LogValue() slog.Value
- func (m MaskedText) MarshalJSON() ([]byte, error)
- func (m MaskedText) MarshalYAML() (interface{}, error)
- func (m MaskedText) Plain() string
- func (m MaskedText) String() string
- func (m *MaskedText) UnmarshalJSON(v []byte) error
- func (m *MaskedText) UnmarshalYAML(value *yaml.Node) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FixedMaskFunc ¶
FixedMaskFunc masks the input string with a fixed mask and returns the masked string.
func MaskEmailFunc ¶
MaskEmailFunc masks the email address by replacing characters with asterisks. It takes a string parameter representing the email address and returns the masked email address.
func MaskPhoneFunc ¶
MaskPhoneFunc masks the last four digits of a phone number. If the input string is less than four characters, it returns "****". Otherwise, it replaces the last four characters with "****".
Types ¶
type MaskedText ¶
type MaskedText struct {
// contains filtered or unexported fields
}
func NewMaskedText ¶
func NewMaskedText(s string, mask func(string) string) MaskedText
func (MaskedText) LogValue ¶
func (m MaskedText) LogValue() slog.Value
func (MaskedText) MarshalJSON ¶
func (m MaskedText) MarshalJSON() ([]byte, error)
func (MaskedText) MarshalYAML ¶
func (m MaskedText) MarshalYAML() (interface{}, error)
func (MaskedText) Plain ¶
func (m MaskedText) Plain() string
func (MaskedText) String ¶
func (m MaskedText) String() string
func (*MaskedText) UnmarshalJSON ¶
func (m *MaskedText) UnmarshalJSON(v []byte) error
func (*MaskedText) UnmarshalYAML ¶
func (m *MaskedText) UnmarshalYAML(value *yaml.Node) error
Click to show internal directories.
Click to hide internal directories.