whatphone

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	AccountSID string
	AuthToken  string
}

API holds everyoneapi authentication information

func New

func New(accountsid string, authtoken string) *API

New returns a new API object

func (*API) Lookup

func (a *API) Lookup(phonenumber string, opts ...Option) (*Result, error)

Lookup performs a phone number lookup and returns the Result

type Breakdown

type Breakdown struct {
	Address      float64 `json:"address"`
	Carrier      float64 `json:"carrier"`
	Carrier0     float64 `json:"carrier_0"`
	Cnam         float64 `json:"cnam"`
	ExpandedName int     `json:"expanded_name"`
	Gender       float64 `json:"gender"`
	Image        float64 `json:"image"`
	LineProvider float64 `json:"line_provider"`
	Linetype     float64 `json:"linetype"`
	Location     float64 `json:"location"`
	Name         float64 `json:"name"`
	Profile      float64 `json:"profile"`
}

Breakdown holds the pricing breakdown of a phone number lookup

type Carrier

type Carrier struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

Carrier holds data about the carrier that is currently providing line service

type CarrierO

type CarrierO struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

CarrierO holds data about the carrier originally assigned the phone number

type Data

type Data struct {
	Address      *string       `json:"address"`
	Carrier      *Carrier      `json:"carrier"`
	CarrierO     *CarrierO     `json:"carrier_o"`
	Cnam         *string       `json:"cnam"`
	ExpandedName *ExpandedName `json:"expanded_name"`
	Gender       *string       `json:"gender"`
	Image        *Image        `json:"image"`
	LineProvider *LineProvider `json:"line_provider"`
	Linetype     *string       `json:"linetype"`
	Location     *Location     `json:"location"`
	Name         *string       `json:"name"`
	Profile      *Profile      `json:"profile"`
}

Data holds the personal info fields returned by a phone number lookup

type ExpandedName

type ExpandedName struct {
	First string `json:"first"`
	Last  string `json:"last"`
}

ExpandedName holds the full name returned by a phone number lookup

type Geo

type Geo struct {
	Latitude  string `json:"latitude"`
	Longitude string `json:"longitude"`
}

Geo holds the geographical data returned by a phone number lookup

type Image

type Image struct {
	Cover string `json:"cover"`
	Large string `json:"large"`
	Med   string `json:"med"`
	Small string `json:"small"`
}

Image holds the image URLs returned by a phone number lookup. These links expire after 30 days.

type LineProvider

type LineProvider struct {
	ID       string `json:"id"`
	MmsEmail string `json:"mms_email"`
	Name     string `json:"name"`
	SmsEmail string `json:"sms_email"`
}

LineProvider holds the consumer facing line provider (e.g. Google Voice, or MagicJack)

type Location

type Location struct {
	City  string `json:"city"`
	Geo   Geo    `json:"geo"`
	State string `json:"state"`
	Zip   string `json:"zip"`
}

Location holds the location data returned by a phone number lookup

type Option

type Option func(f *fields)

Option adds a field to the list of fields being requested from the API. See "Data Points" section at https://www.everyoneapi.com/docs for more info

func WithAddress

func WithAddress() Option

WithAddress adds the "address" field to the list of fields being requested from the API

func WithCNAM

func WithCNAM() Option

WithCNAM adds the "cnam" field to the list of fields being requested from the API

func WithCarrier

func WithCarrier() Option

WithCarrier adds the "carrier" field to the list of fields being requested from the API

func WithGender

func WithGender() Option

WithGender adds the "gender" field to the list of fields being requested from the API

func WithImage

func WithImage() Option

WithImage adds the "image" field to the list of fields being requested from the API

func WithLineProvider

func WithLineProvider() Option

WithLineProvider adds the "line_provider" field to the list of fields being requested from the API

func WithLineType

func WithLineType() Option

WithLineType adds the "line_type" field to the list of fields being requested from the API

func WithLocation

func WithLocation() Option

WithLocation adds the "location" field to the list of fields being requested from the API

func WithName

func WithName() Option

WithName adds the "name" field to the list of fields being requested from the API

func WithOriginalCarrier

func WithOriginalCarrier() Option

WithOriginalcarrier adds the "carrier_o" field to the list of fields being requested from the API

func WithProfile

func WithProfile() Option

WithProfile adds the "profile" field to the list of fields being requested from the API

type Pricing

type Pricing struct {
	Breakdown Breakdown `json:"breakdown"`
	Total     float64   `json:"total"`
}

Pricing holds the pricing data of a phone number lookup

type Profile

type Profile struct {
	Edu          string `json:"edu"`
	Job          string `json:"job"`
	Relationship string `json:"relationship"`
}

Profile holds the profile data returned by a phone number lookup

type Result

type Result struct {
	Data    Data     `json:"data"`
	Missed  []string `json:"missed"`
	Number  string   `json:"number"`
	Note    string   `json:"note"`
	Pricing Pricing  `json:"pricing"`
	Status  bool     `json:"status"`
	Type    string   `json:"type"`
}

Result holds the results of a phone number lookup

Jump to

Keyboard shortcuts

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