Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBlockList ¶
func NewBlockList() blocklist
NewBlockList creates a new domain blocklist from an embedded list of allowed domains. Returns a blocklist that can be used to validate if email domains are allowed.
Types ¶
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
Validator provides email validation using a set of validation functions.
func NewValidator ¶
func NewValidator() Validator
NewValidator returns a new Validator with no validation functions.
func (Validator) Validate ¶
Validate runs all validation functions on the provided email string. It returns true if all validations pass, or false and an error if any fail.
func (Validator) WithBlocklistValidation ¶
WithBlocklistValidation adds disposable email validation to the Validator. It returns a new Validator with the validateBlocklist function appended.
func (Validator) WithDNSValidation ¶
WithDNSValidation adds DNS-based email validation to the Validator. It returns a new Validator with the validateDNS function appended.
func (Validator) WithFormValidation ¶
WithFormValidation adds form-based email validation to the Validator. It returns a new Validator with the validateForm function appended.