Documentation ¶
Index ¶
- Variables
- type Config
- type Domain
- type Email
- type V
- func (v *V) A(host string) bool
- func (v *V) CNAME(host string) bool
- func (v *V) Domain(domain string) bool
- func (v *V) DomainString(domain string) bool
- func (v *V) Email(email, returnPath string, optionalSenderIP ...net.IP) bool
- func (v *V) GetBase(domain string) string
- func (v *V) MX(host string) bool
- func (v *V) NS(host string, contains ...string) bool
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Email Email // Email config Domain Domain // Domain config Log func(msg string, args ...any) // Log func }
Config of the validator
type Domain ¶
type Domain struct { // Enforce enforces domain check and rejects empty domains Enforce bool // PrivateSuffixes considers subdomains with the following suffixes as domains PrivateSuffixes []string }
Domain checks configuration
type Email ¶
type Email struct { // Enforce enforces email check and rejects empty emails Enforce bool // SMTP enforces SMTP check (email actually exists on mail server) and rejects non-existing emails SMTP bool // SPF enforces SPF record check (sender allowed to use that email and send emails) and rejects unathorized emails SPF bool // MX enforces MX records check on email's mail server MX bool // From is a valid email address that will be used for SMTP checks From string // Spamlist is a list of spam emails with wildcards Spamlist []string // contains filtered or unexported fields }
Email checks configuration
type V ¶
type V struct {
// contains filtered or unexported fields
}
V is a validator implementation
func (*V) DomainString ¶
DomainString checks if domain string / value is valid using string checks like length and regexp
func (*V) Email ¶
Email checks if email is valid returnPath and optionalSenderIP are optional fields
Click to show internal directories.
Click to hide internal directories.