masked

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FixedMaskFunc

func FixedMaskFunc(s string) string

FixedMaskFunc masks the input string with a fixed mask and returns the masked string.

func MaskEmailFunc

func MaskEmailFunc(s string) string

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

func MaskPhoneFunc(s string) string

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL