mailboxvalidator

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: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MissingParameter        int32 = 100
	MissingParameterMessage       = "Missing parameter."
	UnknownErrorMessage           = "Unknown error."
)

Error constants

View Source
const (
	// MBVTrue is "true" in the return
	MBVTrue = "True"
	// MBVFalse is "False" in the return
	MBVFalse = "False"
	// MBVEmpty is "" in the return
	MBVEmpty = ""
)
View Source
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

func EmailFromString(email string) evmail.Address

EmailFromString creates evmail.Address from string

func NewDepValidator

func NewDepValidator(smtpValidator ev.Validator) ev.Validator

NewDepValidator returns the mailboxvalidator validator

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

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

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

func NewEmptyBool(boolean bool) EmptyBool

NewEmptyBool create EmptyBool with bool

func NewEmptyBoolWithNil

func NewEmptyBoolWithNil() EmptyBool

NewEmptyBoolWithNil create EmptyBool with nil

func ToBool

func ToBool(value string) (result EmptyBool)

ToBool converts string to bool

func (*EmptyBool) MarshalJSON

func (e *EmptyBool) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (EmptyBool) ToBool

func (e EmptyBool) ToBool() bool

ToBool returns boolean value

func (EmptyBool) ToString

func (e EmptyBool) ToString() string

ToString converts bool to string

func (*EmptyBool) UnmarshalJSON

func (e *EmptyBool) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.UnmarshalJSON

type FuncCalculateScore

type FuncCalculateScore func(presentation DepPresentation) float64

FuncCalculateScore is a interface for calculation score function

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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