kickbox

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2016 License: MIT Imports: 7 Imported by: 0

README

kickbox

An easy-to-use Go library using Kickbox.io for email address validation

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(apiKey string) Client

func (Client) SetTimeout

func (c Client) SetTimeout(time time.Duration)

Configure the request timeout value (includes connecting, waiting for a response, and reading the response)

func (Client) Verify

func (c Client) Verify(address string) (*Result, error)

Verify the given email address using Kickbox.io

type KickboxResultBuilder

type KickboxResultBuilder struct{}

Define our builder type that implements the ResultBuilder interface

func (KickboxResultBuilder) NewResult

func (b KickboxResultBuilder) NewResult(response []byte) (*Result, error)

Creates a new Result object from an JSON API response

type Result

type Result struct {
	Success   bool    `json::"success"`
	Result    string  `json::"result"`
	Reason    string  `json::"reason"`
	Role      bool    `json::"role"`
	Free      bool    `json::"free"`
	AcceptAll bool    `json::"accept_all"`
	Suggested string  `json::"did_you_mean"`
	Sendex    float32 `json::"sendex"`
	Email     string  `json::"email"`
	User      string  `json::"user"`
	Domain    string  `json::"domain"`
	Message   string  `json::"message"`
}

This is our actual Result struct we store the API response in

func (Result) IsDeliverable

func (r Result) IsDeliverable() bool

func (Result) IsRisky

func (r Result) IsRisky() bool

func (Result) IsUndeliverable

func (r Result) IsUndeliverable() bool

func (Result) IsUnknown

func (r Result) IsUnknown() bool

type ResultBuilder

type ResultBuilder interface {
	NewResult(response []byte) (*Result, error)
}

Define our interface

Jump to

Keyboard shortcuts

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