Documentation
¶
Index ¶
- func CreditCard(cardNumber string, opts ...func(*Config[CreditCardConfig])) (string, error)
- func DefaultMasker[T any](m Masker[T]) defaultMasker
- func Email(email string, opts ...func(*Config[EmailConfig])) (string, error)
- func FullName(name string, opts ...func(*Config[FullNameConfig])) (string, error)
- func IPv4Addr(ip string, opts ...func(*Config[IPv4AddrConfig])) (string, error)
- func Of(kind string) (m defaultMasker, found bool)
- func Register(kind string, m defaultMasker)
- type Config
- type CreditCardConfig
- type EmailConfig
- type FullNameConfig
- type IPv4AddrConfig
- type Masker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreditCard ¶ added in v0.6.0
func CreditCard(cardNumber string, opts ...func(*Config[CreditCardConfig])) (string, error)
func DefaultMasker ¶
DefaultMasker takes a masker and return the default masker associated with.
func FullName ¶ added in v0.6.0
func FullName(name string, opts ...func(*Config[FullNameConfig])) (string, error)
FullName masks a full name in the format "J*** ***** ***** D**".
Types ¶
type Config ¶
Config is the generic mask config required by any registered mask.
The Type parameter represents the mask specific config.
func DefaultConfig ¶
DefaultConfig wraps the specific mask config and returns a generic one with defaults.
type CreditCardConfig ¶ added in v0.6.0
type CreditCardConfig struct {
MaskBankIdentifier bool // default false
}
type EmailConfig ¶
type EmailConfig struct {
MaskDomain bool // default false
}
type FullNameConfig ¶ added in v0.6.0
type FullNameConfig struct {
}
type IPv4AddrConfig ¶
Click to show internal directories.
Click to hide internal directories.