api

package
v0.0.0-...-5bf27f7 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2018 License: BSD-3-Clause Imports: 5 Imported by: 17

Documentation

Index

Constants

View Source
const (
	// FormatJSON is the format constant for a JSON output
	FormatJSON = "json"
	// FormatJSONP is the format constant for a JSONP output
	FormatJSONP = "jsonp"
	// FormatXML is the format constant for a XML output
	FormatXML = "xml"
)

Variables

View Source
var (
	// ErrMissingCallback is thrown when the request is missing the
	// callback queryparam
	ErrMissingCallback = echo.NewHTTPError(http.StatusBadRequest,
		"Missing callback queryparam")
	// ErrUnsupportedFormat is thrown when the requestor has
	// defined an unsupported response format
	ErrUnsupportedFormat = echo.NewHTTPError(http.StatusBadRequest,
		"Unsupported format specified")
)

Functions

func FormatEncoder

func FormatEncoder(c echo.Context, code int, res interface{}) error

FormatEncoder is an encoder that reads the format from the passed echo context and writes the status code and response based on that format on the URL

func HealthHandler

func HealthHandler() echo.HandlerFunc

HealthHandler returns a HealthResponse indicating the current health state of the service

func LookupHandler

func LookupHandler(v *verifier.Verifier) echo.HandlerFunc

LookupHandler performs a single email verification and returns a fully populated lookup or an error

Types

type Health

type Health struct {
	Status string `json:"status"`
}

Health is a healthcheck response body

type Lookup

type Lookup struct {
	XMLName     xml.Name `json:"-" xml:"lookup"`
	Address     string   `json:"address" xml:"address"`
	Username    string   `json:"username" xml:"username"`
	Domain      string   `json:"domain" xml:"domain"`
	MD5Hash     string   `json:"md5Hash" xml:"md5Hash"`
	ValidFormat bool     `json:"validFormat" xml:"validFormat"`
	Deliverable bool     `json:"deliverable" xml:"deliverable"`
	FullInbox   bool     `json:"fullInbox" xml:"fullInbox"`
	HostExists  bool     `json:"hostExists" xml:"hostExists"`
	CatchAll    bool     `json:"catchAll" xml:"catchAll"`
}

Lookup contains all output data for an email verification Lookup

Jump to

Keyboard shortcuts

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