Documentation ¶
Overview ¶
package sensitive provides a way to create sensitive data types
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Email ¶
type Email struct {
masked.MaskedText
}
Email represents a sensitive email address.
func NewEmailWithMask ¶
NewEmailWithMask creates a new Email instance with a custom masking function.
type MaskFunc ¶
MaskFunc is a function type that takes a string as input and returns a masked string. It is used to define custom masking functions for sensitive data.
type Password ¶
type Password struct {
masked.MaskedText
}
Password represents a sensitive password value.
Example ¶
package main import ( "fmt" "github.com/pedrolemes/sensitive" ) func main() { p := sensitive.NewPassword("my-password") fmt.Println(p) }
Output: ****
func NewPassword ¶
NewPassword creates a new Password instance with a default mask.
func NewPasswordWithMask ¶
NewPasswordWithMask creates a new Password instance with a custom mask.
Example ¶
package main import ( "fmt" "github.com/pedrolemes/sensitive" ) func main() { p := sensitive.NewPasswordWithMask("my-password", func(s string) string { return "---" }) fmt.Println(p) }
Output: ---
type Phone ¶
type Phone struct {
masked.MaskedText
}
Phone represents a sensitive phone number.
func NewPhoneWithMask ¶
NewPhoneWithMask creates a new Phone instance with a custom mask.