Documentation ¶
Index ¶
- Constants
- func CalculateScore(presentation DepPresentation) float64
- func EmailFromString(email string) evmail.Address
- func NewDepValidator(smtpValidator ev.Validator) ev.Validator
- type DepConverter
- type DepConverterForView
- type DepPresentation
- type DepPresentationForView
- type EmptyBool
- type FuncCalculateScore
Constants ¶
const ( MissingParameter int32 = 100 MissingParameterMessage = "Missing parameter." UnknownErrorMessage = "Unknown error." )
Error constants
const ( // MBVTrue is "true" in the return MBVTrue = "True" // MBVFalse is "False" in the return MBVFalse = "False" // MBVEmpty is "" in the return MBVEmpty = "" )
const Name converter.Name = "MailBoxValidator"
Name of MailBoxValidator converter
Variables ¶
This section is empty.
Functions ¶
func CalculateScore ¶
func CalculateScore(presentation DepPresentation) float64
CalculateScore calculates scores for the MailboxvalidatorScore field
func EmailFromString ¶
EmailFromString creates evmail.Address from string
Types ¶
type DepConverter ¶
type DepConverter struct {
// contains filtered or unexported fields
}
DepConverter is the converter for https://www.mailboxvalidator.com/
func NewDepConverter ¶
func NewDepConverter(calculateScore FuncCalculateScore) DepConverter
NewDepConverter is the constructor
func NewDepConverterDefault ¶
func NewDepConverterDefault() DepConverter
NewDepConverterDefault is the default constructor
func (DepConverter) Can ¶
func (DepConverter) Can(_ evmail.Address, result ev.ValidationResult, opts converter.Options) bool
Can ev.ValidationResult be converted in DepConverter
func (DepConverter) Convert ¶
func (d DepConverter) Convert(email evmail.Address, resultInterface ev.ValidationResult, opts converter.Options) (result interface{})
Convert ev.ValidationResult in mailboxvalidator presentation
type DepConverterForView ¶
type DepConverterForView struct {
// contains filtered or unexported fields
}
DepConverterForView is the converter for mailbox
func NewDepConverterForView ¶
func NewDepConverterForView(depConverter DepConverter) DepConverterForView
NewDepConverterForView creates DepConverterForView
func NewDepConverterForViewDefault ¶
func NewDepConverterForViewDefault() DepConverterForView
NewDepConverterForViewDefault creates default DepConverterForView
func (DepConverterForView) Can ¶
func (d DepConverterForView) Can(email evmail.Address, result ev.ValidationResult, opts converter.Options) bool
Can be used to convert ev.ValidationResult in DepConverterForView
func (DepConverterForView) Convert ¶
func (d DepConverterForView) Convert(email evmail.Address, resultInterface ev.ValidationResult, opts converter.Options) interface{}
Convert converts the result in mailboxvalidator presentation TODO add processing of "-" in mailbox validator, for example zxczxczxc@joycasinoru
type DepPresentation ¶
type DepPresentation struct { EmailAddress string `json:"email_address"` Domain string `json:"domain"` IsFree EmptyBool `json:"is_free"` IsSyntax EmptyBool `json:"is_syntax"` IsDomain EmptyBool `json:"is_domain"` IsSMTP EmptyBool `json:"is_smtp"` IsVerified EmptyBool `json:"is_verified"` IsServerDown EmptyBool `json:"is_server_down"` IsGreylisted EmptyBool `json:"is_greylisted"` IsDisposable EmptyBool `json:"is_disposable"` IsSuppressed EmptyBool `json:"is_suppressed"` IsRole EmptyBool `json:"is_role"` IsHighRisk EmptyBool `json:"is_high_risk"` IsCatchall EmptyBool `json:"is_catchall"` MailboxvalidatorScore float64 `json:"mailboxvalidator_score"` TimeTaken time.Duration `json:"time_taken"` Status EmptyBool `json:"status"` CreditsAvailable uint32 `json:"credits_available"` ErrorCode string `json:"error_code"` ErrorMessage string `json:"error_message"` }
DepPresentation is representation of https://www.mailboxvalidator.com/
type DepPresentationForView ¶
type DepPresentationForView struct { EmailAddress string `json:"email_address"` Domain string `json:"domain"` IsFree string `json:"is_free"` IsSyntax string `json:"is_syntax"` IsDomain string `json:"is_domain"` IsSMTP string `json:"is_smtp"` IsVerified string `json:"is_verified"` IsServerDown string `json:"is_server_down"` IsGreylisted string `json:"is_greylisted"` IsDisposable string `json:"is_disposable"` IsSuppressed string `json:"is_suppressed"` IsRole string `json:"is_role"` IsHighRisk string `json:"is_high_risk"` IsCatchall string `json:"is_catchall"` MailboxvalidatorScore string `json:"mailboxvalidator_score"` TimeTaken string `json:"time_taken"` Status string `json:"status"` CreditsAvailable uint32 `json:"credits_available"` ErrorCode string `json:"error_code"` ErrorMessage string `json:"error_message"` }
DepPresentationForView is the DepPresentation but all fields are string
func (*DepPresentationForView) UnmarshalJSON ¶
func (d *DepPresentationForView) UnmarshalJSON(data []byte) error
UnmarshalJSON is an implementation of Unmarshaler.UnmarshalJSON
type EmptyBool ¶
type EmptyBool struct {
// contains filtered or unexported fields
}
EmptyBool is a type for mailboxvalidator bool
func NewEmptyBool ¶
NewEmptyBool create EmptyBool with bool
func NewEmptyBoolWithNil ¶
func NewEmptyBoolWithNil() EmptyBool
NewEmptyBoolWithNil create EmptyBool with nil
func (*EmptyBool) MarshalJSON ¶
MarshalJSON implements json.Marshaler
func (*EmptyBool) UnmarshalJSON ¶
UnmarshalJSON implements json.UnmarshalJSON
type FuncCalculateScore ¶
type FuncCalculateScore func(presentation DepPresentation) float64
FuncCalculateScore is a interface for calculation score function