Documentation ¶
Index ¶
Constants ¶
const Name converter.Name = "CheckIfEmailExist"
Name of https://github.com/reacherhq/check-if-email-exists or https://reacher.email/ converter
Variables ¶
This section is empty.
Functions ¶
func NewDepValidator ¶
NewDepValidator is the default validator for https://github.com/reacherhq/check-if-email-exists
Types ¶
type Availability ¶
type Availability string
Availability is a type
const ( Risky Availability = "risky" Invalid Availability = "invalid" Safe Availability = "safe" Unknown Availability = "unknown" )
Availability constants
func CalculateAvailability ¶
func CalculateAvailability(depPresentation DepPresentation) Availability
CalculateAvailability calculates availability status
func (Availability) String ¶
func (a Availability) String() string
type DepConverter ¶
type DepConverter struct {
// contains filtered or unexported fields
}
DepConverter converts ev.ValidationResult in check-if-email-exists or https://reacher.email/ presentation
func NewDepConverter ¶
func NewDepConverter(converter converter.CompositeConverter, calculateAvailability FuncAvailability) DepConverter
NewDepConverter creates DepConverter
func NewDepConverterDefault ¶
func NewDepConverterDefault() DepConverter
NewDepConverterDefault creates a default DepConverter
func (DepConverter) Can ¶
func (DepConverter) Can(_ evmail.Address, result ev.ValidationResult, _ converter.Options) bool
Can ev.ValidationResult be converted in DepPresentation
func (DepConverter) Convert ¶
func (s DepConverter) Convert(email evmail.Address, result ev.ValidationResult, opts converter.Options) interface{}
Convert ev.ValidationResult in DepPresentation
type DepPresentation ¶
type DepPresentation struct { Input string `json:"input"` IsReachable Availability `json:"is_reachable"` Misc miscPresentation `json:"misc"` MX mxPresentation `json:"mx"` SMTP SMTPPresentation `json:"smtp"` Syntax SyntaxPresentation `json:"syntax"` Error string `json:"error"` }
DepPresentation is representation of https://github.com/amaurymartiny/check-if-email-exists or https://reacher.email
type FuncAvailability ¶
type FuncAvailability func(depPresentation DepPresentation) Availability
FuncAvailability is an interface to calculate availability
type SMTPPresentation ¶
type SMTPPresentation struct { CanConnectSMTP bool `json:"can_connect_smtp"` HasFullInbox bool `json:"has_full_inbox"` IsCatchAll bool `json:"is_catch_all"` IsDeliverable bool `json:"is_deliverable"` IsDisabled bool `json:"is_disabled"` }
SMTPPresentation is a smtp presentation for check-if-email-exists
type SyntaxConverter ¶
type SyntaxConverter struct{}
SyntaxConverter converts ev.ValidationResult in SyntaxConverter
func (SyntaxConverter) Can ¶
func (SyntaxConverter) Can(_ evmail.Address, result ev.ValidationResult, _ converter.Options) bool
Can ev.ValidationResult be converted in SyntaxConverter
func (SyntaxConverter) Convert ¶
func (SyntaxConverter) Convert(email evmail.Address, result ev.ValidationResult, _ converter.Options) interface{}
Convert ev.ValidationResult in SyntaxPresentation