Documentation ¶
Index ¶
- type BatchRequest
- type BatchResponse
- type BatchStatusRequest
- type BatchStatusResponse
- type EmailState
- type Emailable
- func (emailable *Emailable) BatchFromFile(file io.Reader) ([]BatchResponse, error)
- func (emailable *Emailable) BatchStatus(req *BatchStatusRequest) (*BatchStatusResponse, error)
- func (emailable *Emailable) BatchVerify(req BatchRequest) (*BatchResponse, error)
- func (emailable *Emailable) NewBatchReq(emails []string) BatchRequest
- func (emailable *Emailable) NewBatchVerificationReq(id string) BatchStatusRequest
- func (emailable *Emailable) NewVerifyReq(email string) VerifyRequest
- func (emailable *Emailable) Verify(req VerifyRequest) (*VerifyResponse, error)
- type ReasonCount
- type SimulateValue
- type TotalCounts
- type VerifyRequest
- type VerifyResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchRequest ¶
type BatchRequest struct { Emails []string `json:"emails"` // A comma separated list of emails. Url string `json:"url"` // A URL that will receive the batch results via HTTP POST. Retries bool `json:"retries"` // Defaults to true. Retries increase accuracy by automatically retrying verification when our system receives certain responses from mail servers. Simulate SimulateValue `json:"string"` // Used to simulate certain responses from the API while using a test key. ApiKey string `json:"api_key"` }
type BatchResponse ¶
type BatchStatusRequest ¶
type BatchStatusResponse ¶
type BatchStatusResponse struct { Message string `json:"message"` Processed int64 `json:"processed"` Total int64 `json:"total"` Emails []VerifyResponse `json:"emails"` Id string `json:"id"` ReasonCount ReasonCount `json:"reason_counts"` TotalCounts TotalCounts `json:"total_counts"` }
type EmailState ¶
type EmailState string
const ( ValidEmail EmailState = "valid" InvalidEmail EmailState = "invalid" RiskyEmail EmailState = "risky" BouncedEmail EmailState = "bounced" UnknownEmail EmailState = "unknown" )
type Emailable ¶
type Emailable struct {
// contains filtered or unexported fields
}
func NewEmailable ¶
func (*Emailable) BatchFromFile ¶
func (emailable *Emailable) BatchFromFile(file io.Reader) ([]BatchResponse, error)
func (*Emailable) BatchStatus ¶
func (emailable *Emailable) BatchStatus(req *BatchStatusRequest) (*BatchStatusResponse, error)
func (*Emailable) BatchVerify ¶
func (emailable *Emailable) BatchVerify(req BatchRequest) (*BatchResponse, error)
func (*Emailable) NewBatchReq ¶
func (emailable *Emailable) NewBatchReq(emails []string) BatchRequest
func (*Emailable) NewBatchVerificationReq ¶
func (emailable *Emailable) NewBatchVerificationReq(id string) BatchStatusRequest
func (*Emailable) NewVerifyReq ¶
func (emailable *Emailable) NewVerifyReq(email string) VerifyRequest
func (*Emailable) Verify ¶
func (emailable *Emailable) Verify(req VerifyRequest) (*VerifyResponse, error)
type ReasonCount ¶
type ReasonCount struct { AcceptedEmail int64 `json:"accepted_email"` InvalidDomain int64 `json:"invalid_domain"` InvalidEmail int64 `json:"invalid_email"` InvalidSmtp int64 `json:"invalid_smtp"` LowDeliverability int64 `json:"low_deliverability"` LowQuality int64 `json:"low_quality"` NoConnect int64 `json:"no_connect"` RejectedEmail int64 `json:"rejected_email"` Timeout int64 `json:"timeout"` UnexpectedError int64 `json:"unexpected_error"` }
type SimulateValue ¶
type SimulateValue string
const ( GenericError SimulateValue = "generic_error" InsufficientCreditsError SimulateValue = "insufficient_credits_error" PaymentError SimulateValue = "payment_error" CardError SimulateValue = "card_error" )
type TotalCounts ¶
type VerifyRequest ¶
type VerifyRequest struct { Email string `json:"email"` // The email you want verified. Smtp bool `json:"smtp"` // "true" or "false". The SMTP step takes up a majority of the API's response time. If you would like to speed up your response times, you can disable this step. Default: true AcceptAll bool `json:"accept_all"` // "true" or "false". Whether or not an accept-all check is performed. Heavily impacts API's response time. Default: false Timeout uint8 `json:"timeout"` // Optional timeout to wait for response (in seconds). Min: 5, Max: 30. Default: 5 ApiKey string `json:"api_key"` }
type VerifyResponse ¶
type VerifyResponse struct { AcceptAll bool `json:"accept_all"` // Whether the mail server used to verify indicates that all addresses are deliverable regardless of whether or not the email is valid. DidYouMean string `json:"did_you_mean"` // A suggested correction for a common misspelling. Disposable bool `json:"disposable"` // Whether this email is hosted on a disposable or temporary email service. Domain string `json:"domain"` // The domain of the email. Duration float64 `json:"duration"` // The length of time (in seconds) spent verifying this email. Email string `json:"email"` // The email that was verified. FirstName string `json:"first_name"` // The possible first name of the user. Free bool `json:"free"` // Whether the email is hosted by a free email provider. FullName string `json:"full_name"` // The possible full name of the user. Gender string `json:"gender"` // The possible gender of the user. LastName string `json:"last_name"` // The possible last name of the user. MxRecord string `json:"mx_record"` // The address of the mail server used to verify the email. Reason string `json:"reason"` // The reason for the associated state. Role bool `json:"role"` // Whether the email is considered a role address. Score int32 `json:"score"` // The score of the verified email. SmtpProvider string `json:"smtp_provider"` // The SMTP provider of the verified email's domain. State EmailState `json:"state"` // The state of the verified email Tag string `json:"tag"` // The tag part of the verified email. User string `json:"user"` // The user part of the verified email. }
Click to show internal directories.
Click to hide internal directories.