email

package
v2.26.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 20, 2025 License: MIT Imports: 6 Imported by: 0

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

func (v Validator) Validate(email string) (bool, error)

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

func (v Validator) WithBlocklistValidation() Validator

WithBlocklistValidation adds disposable email validation to the Validator. It returns a new Validator with the validateBlocklist function appended.

func (Validator) WithDNSValidation

func (v Validator) WithDNSValidation() Validator

WithDNSValidation adds DNS-based email validation to the Validator. It returns a new Validator with the validateDNS function appended.

func (Validator) WithFormValidation

func (v Validator) WithFormValidation() Validator

WithFormValidation adds form-based email validation to the Validator. It returns a new Validator with the validateForm function appended.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL