asemailverifier

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Name of https://github.com/AfterShip/email-verifier converter
	Name converter.Name = "AfterShipEmailVerifier"

	// EmailRegexString is an email regex
	EmailRegexString = "" /* 1277-byte string literal not displayed */
)

Variables

This section is empty.

Functions

func NewDepValidator

func NewDepValidator(smtpValidator ev.Validator) ev.Validator

NewDepValidator is a default validator

Types

type DepConverter

type DepConverter struct {
	// contains filtered or unexported fields
}

DepConverter converts ev.ValidationResult in DepPresentation

func NewDepConverter

func NewDepConverter(converter converter.CompositeConverter, calculateReachable FuncReachable) DepConverter

NewDepConverter creates DepConverter

func NewDepConverterDefault

func NewDepConverterDefault() DepConverter

NewDepConverterDefault creates default DepConverter

func (DepConverter) Can

Can ev.ValidationResult be converted in DepConverter

func (DepConverter) Convert

func (s DepConverter) Convert(email evmail.Address, resultInterface ev.ValidationResult, opts converter.Options) interface{}

Convert ev.ValidationResult in DepConverter

type DepPresentation

type DepPresentation struct {
	Email        string                `json:"email"`
	Reachable    Reachable             `json:"reachable"`
	Syntax       *SyntaxPresentation   `json:"syntax"`
	SMTP         *SMTPPresentation     `json:"smtp"`
	Gravatar     *GravatarPresentation `json:"gravatar"`
	Suggestion   string                `json:"suggestion"`
	Disposable   bool                  `json:"disposable"`
	RoleAccount  bool                  `json:"role_account"`
	Free         bool                  `json:"free"`
	HasMxRecords bool                  `json:"has_mx_records"`
}

DepPresentation is a presentation

type FuncReachable

type FuncReachable func(depPresentation DepPresentation) Reachable

FuncReachable is an interface to calculate Reachable

type GravatarConverter

type GravatarConverter struct{}

GravatarConverter converts ev.ValidationResult in GravatarPresentation

func (GravatarConverter) Can

Can ev.ValidationResult be converted in GravatarPresentation

func (GravatarConverter) Convert

func (GravatarConverter) Convert(_ evmail.Address, result ev.ValidationResult, _ converter.Options) interface{}

Convert ev.ValidationResult in GravatarPresentation

type GravatarPresentation

type GravatarPresentation struct {
	HasGravatar bool
	GravatarURL string
}

GravatarPresentation is presentation for ev.GravatarValidationResult

type Reachable

type Reachable string

Reachable is a type

const (
	ReachableYes     Reachable = "yes"
	ReachableNo      Reachable = "no"
	ReachableUnknown Reachable = "unknown"
)

Reachable constants

func CalculateReachable

func CalculateReachable(depPresentation DepPresentation) Reachable

CalculateReachable returns Reachable status

func (Reachable) String

func (a Reachable) String() string

type SMTPPresentation

type SMTPPresentation struct {
	HostExists  bool `json:"host_exists"`
	FullInbox   bool `json:"full_inbox"`
	CatchAll    bool `json:"catch_all"`
	Deliverable bool `json:"deliverable"`
	Disabled    bool `json:"disabled"`
}

SMTPPresentation for smtp validator

type SyntaxConverter

type SyntaxConverter struct{}

SyntaxConverter converts ev.ValidationResult in SyntaxPresentation

func (SyntaxConverter) Can

Can ev.ValidationResult be converted in SyntaxPresentation

func (SyntaxConverter) Convert

func (SyntaxConverter) Convert(email evmail.Address, result ev.ValidationResult, _ converter.Options) interface{}

Convert ev.ValidationResult in SyntaxPresentation

type SyntaxPresentation

type SyntaxPresentation struct {
	Username string `json:"username"`
	Domain   string `json:"domain"`
	Valid    bool   `json:"valid"`
}

SyntaxPresentation is a syntax result

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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