converter

package
v0.0.0-...-b8b9e6a Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	WithoutErrsSMTPPresentation = SMTPPresentation{
		CanConnectSMTP: true,
		HasFullInbox:   false,
		IsCatchAll:     true,
		IsDeliverable:  true,
		IsDisabled:     false,
		IsGreyListed:   false,
	}
	FalseSMTPPresentation = SMTPPresentation{
		CanConnectSMTP: false,
		HasFullInbox:   false,
		IsCatchAll:     false,
		IsDeliverable:  false,
		IsDisabled:     false,
		IsGreyListed:   false,
	}
)

Default results

Functions

func EmailsForTests

func EmailsForTests() []string

EmailsForTests returns emails for tests

func MX2String

func MX2String(MXs evsmtp.MXs) []string

MX2String converts ms records to string array

func NewEmailAddress

func NewEmailAddress(username, domain string, at *string) evmail.Address

NewEmailAddress is a evmail.Address constructor

Types

type CompositeConverter

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

CompositeConverter converts ev.ValidationResult depends of ev.ValidationResult.ValidatorName()

func NewCompositeConverter

func NewCompositeConverter(converters MapConverters) CompositeConverter

NewCompositeConverter creates CompositeConverter

func (CompositeConverter) Can

func (p CompositeConverter) Can(email evmail.Address, result ev.ValidationResult, opts Options) bool

Can result ev.ValidationResult be converted

func (CompositeConverter) Convert

func (p CompositeConverter) Convert(email evmail.Address, result ev.ValidationResult, opts Options) interface{}

Convert ev.ValidationResult depends of ev.ValidationResult.ValidatorName()

type Interface

type Interface interface {
	// Can defines the possibility applying of a converter
	Can(email evmail.Address, result ev.ValidationResult, opts Options) bool
	// Convert converts ev.ValidationResult in some presenter
	Convert(email evmail.Address, result ev.ValidationResult, opts Options) interface{}
}

Interface converts ev.ValidationResult in some presenter

type MapConverters

type MapConverters map[ev.ValidatorName]Interface

MapConverters is a map of converters

type Name

type Name string

Name of converter

type Options

type Options interface {
	IsOptions()
	ExecutedTime() time.Duration
}

Options changes the process of converting

func NewOptions

func NewOptions(executedTime time.Duration) Options

NewOptions creates Options

type SMTPConverter

type SMTPConverter struct{}

SMTPConverter converts ev.ValidationResult in SMTPConverter

func NewSMTPConverter

func NewSMTPConverter() *SMTPConverter

NewSMTPConverter creates SMTPConverter

func (SMTPConverter) Can

Can ev.ValidationResult be converted in SMTPConverter

func (SMTPConverter) Convert

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

Convert ev.ValidationResult in SMTPConverter

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"`
	IsGreyListed   bool `json:"is_grey_listed"`
}

SMTPPresentation is a presentation of smtp from ev.ValidationResult

Jump to

Keyboard shortcuts

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