Documentation
¶
Overview ¶
Package verify checks whether an email address is likely to be deliverable. The PreSignUp hook passes the result to its policy as input.emailVerification.
Index ¶
Constants ¶
View Source
const ( ProviderSendGrid = "sendgrid" ProviderAllowlist = "allowlist" )
Provider names, reported in Result.Provider.
View Source
const ( VerdictValid = sendgrid.VerdictValid VerdictRisky = sendgrid.VerdictRisky VerdictInvalid = sendgrid.VerdictInvalid )
Verdicts. They match the SendGrid validation verdicts.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Allowlist ¶
type Allowlist struct {
// Domains are matched exactly and case-insensitively; subdomains must be
// listed separately.
Domains []string
Next Verifier
}
Allowlist treats addresses in the listed domains as valid without calling Next.
type Result ¶
type Result struct {
// Provider is the verifier that produced the result.
Provider string `json:"provider"`
// Valid is false only when the address is known to be undeliverable.
// Risky addresses are valid.
Valid bool `json:"valid"`
Verdict string `json:"verdict"`
// Score is the likelihood that the address is deliverable, from 0 to 1.
Score float64 `json:"score"`
// Disposable is true when the domain belongs to a disposable email
// service.
Disposable bool `json:"disposable"`
// Role is true when the local part is a role or group address, such as
// admin@.
Role bool `json:"role"`
// Raw is the provider's raw response as a JSON string ("{}" when there is
// none).
Raw string `json:"raw"`
}
Result is the outcome of verifying one address.
Click to show internal directories.
Click to hide internal directories.