autocomplete

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2019 License: Apache-2.0 Imports: 6 Imported by: 1

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
}

Client is responsible for sending batches of addresses to the us-street-api.

func NewClient

func NewClient(sender sdk.RequestSender) *Client

NewClient creates a client with the provided sender.

func (*Client) SendLookup

func (c *Client) SendLookup(lookup *Lookup) error

SendBatch sends the batch of inputs, populating the output for each input if the batch was successful.

type Geolocation

type Geolocation int
const (
	GeolocateCity Geolocation = iota
	GeolocateState
	GeolocateNone
)

type Lookup

type Lookup struct {
	Prefix         string
	MaxSuggestions int
	CityFilter     []string
	StateFilter    []string
	Preferences    []string
	Geolocation    Geolocation
	PreferRatio    float64

	Results []*Suggestion
}

Lookup represents all input fields documented here: https://smartystreets.com/docs/us-autocomplete-api#http-request-input-fields

type Suggestion

type Suggestion struct {
	Text       string `json:"text"`
	StreetLine string `json:"street_line"`
	City       string `json:"city"`
	State      string `json:"state"`
}

Suggestion is the primary element in the response array. Online documentation: https://smartystreets.com/docs/us-autocomplete-api#http-response

Jump to

Keyboard shortcuts

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