autocomplete_pro

package
v1.14.11 Latest Latest
Warning

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

Go to latest
Published: May 12, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

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 of lookups to the us-autocomplete-pro-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.

func (*Client) SendLookupWithContext

func (c *Client) SendLookupWithContext(ctx context.Context, lookup *Lookup) error

type Geolocation

type Geolocation string

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

const (
	GeolocateCity Geolocation = "city"
	GeolocateNone Geolocation = "none"
)

type Lookup

type Lookup struct {
	Search        string
	Source        string
	MaxResults    int
	CityFilter    []string
	StateFilter   []string
	ZIPFilter     []string
	ExcludeStates []string
	PreferCity    []string
	PreferState   []string
	PreferZIP     []string
	PreferRatio   int
	Geolocation   Geolocation

	Results []*Suggestion
}

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

type Suggestion

type Suggestion struct {
	StreetLine string `json:"street_line"`
	Secondary  string `json:"secondary"`
	City       string `json:"city"`
	State      string `json:"state"`
	ZIPCode    string `json:"zipcode"`
	Entries    int    `json:"entries"`
}

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

Jump to

Keyboard shortcuts

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