Documentation ¶
Index ¶
Constants ¶
const ( MatchStrict = MatchStrategy("strict") MatchRange = MatchStrategy("range") MatchInvalid = MatchStrategy("invalid") )
const MaxBatchSize = 100
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Analysis ¶
type Analysis struct { DPVMatchCode string `json:"dpv_match_code,omitempty"` DPVFootnotes string `json:"dpv_footnotes,omitempty"` DPVCMRACode string `json:"dpv_cmra,omitempty"` DPVVacantCode string `json:"dpv_vacant,omitempty"` Active string `json:"active,omitempty"` Footnotes string `json:"footnotes,omitempty"` // https://smartystreets.com/docs/us-street-api#footnotes LACSLinkCode string `json:"lacslink_code,omitempty"` LACSLinkIndicator string `json:"lacslink_indicator,omitempty"` SuiteLinkMatch bool `json:"suitelink_match,omitempty"` EWSMatch bool `json:"ews_match,omitempty"` // deprecated }
Analysis contains all output fields defined here: https://smartystreets.com/docs/us-street-api#analysis
type Batch ¶
type Batch struct {
// contains filtered or unexported fields
}
Batch stores input records and settings related to a group of addresses to be verified in a batch.
func (*Batch) Append ¶
Append includes the record in the collection to be sent if there is still room (max: 100).
type Candidate ¶
type Candidate struct { InputID string `json:"input_id,omitempty"` InputIndex int `json:"input_index"` CandidateIndex int `json:"candidate_index"` Addressee string `json:"addressee,omitempty"` DeliveryLine1 string `json:"delivery_line_1,omitempty"` DeliveryLine2 string `json:"delivery_line_2,omitempty"` LastLine string `json:"last_line,omitempty"` DeliveryPointBarcode string `json:"delivery_point_barcode,omitempty"` Components Components `json:"components,omitempty"` Metadata Metadata `json:"metadata,omitempty"` Analysis Analysis `json:"analysis,omitempty"` }
Candidate contains all output fields defined here: https://smartystreets.com/docs/us-street-api#http-response-output
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) SendBatch ¶
SendBatch sends the batch of inputs, populating the output for each input if the batch was successful.
func (*Client) SendFromChannel ¶
SendFromChannel is a high-level convenience function that leverages an internal reusable Batch to send everything received from the provided input channel in serial, blocking fashion. The same lookups are sent on the output channel as they are processed. Whereas it is the caller's job to close the input channel when all inputs have been sent, the output channel will be closed for the caller.
func (*Client) SendLookups ¶
SendLookups is a high-level convenience function that leverages an internal reusable Batch to send all lookups provided in serial, blocking fashion.
type Components ¶
type Components struct { PrimaryNumber string `json:"primary_number,omitempty"` StreetPredirection string `json:"street_predirection,omitempty"` StreetName string `json:"street_name,omitempty"` StreetPostdirection string `json:"street_postdirection,omitempty"` StreetSuffix string `json:"street_suffix,omitempty"` SecondaryNumber string `json:"secondary_number,omitempty"` SecondaryDesignator string `json:"secondary_designator,omitempty"` ExtraSecondaryNumber string `json:"extra_secondary_number,omitempty"` ExtraSecondaryDesignator string `json:"extra_secondary_designator,omitempty"` PMBNumber string `json:"pmb_number,omitempty"` PMBDesignator string `json:"pmb_designator,omitempty"` CityName string `json:"city_name,omitempty"` DefaultCityName string `json:"default_city_name,omitempty"` StateAbbreviation string `json:"state_abbreviation,omitempty"` ZIPCode string `json:"zipcode,omitempty"` Plus4Code string `json:"plus4_code,omitempty"` DeliveryPoint string `json:"delivery_point,omitempty"` DeliveryPointCheckDigit string `json:"delivery_point_check_digit,omitempty"` Urbanization string `json:"urbanization,omitempty"` }
Components contains all output fields defined here: https://smartystreets.com/docs/us-street-api#components
type Lookup ¶
type Lookup struct { Street string `json:"street,omitempty"` Street2 string `json:"street2,omitempty"` Secondary string `json:"secondary,omitempty"` City string `json:"city,omitempty"` State string `json:"state,omitempty"` ZIPCode string `json:"zipcode,omitempty"` LastLine string `json:"lastline,omitempty"` Addressee string `json:"addressee,omitempty"` Urbanization string `json:"urbanization,omitempty"` InputID string `json:"input_id,omitempty"` MaxCandidates int `json:"candidates,omitempty"` // Default value: 1 MatchStrategy MatchStrategy `json:"match,omitempty"` Results []*Candidate `json:"results,omitempty"` }
Lookup contains all input fields defined here: https://smartystreets.com/docs/us-street-api#input-fields
type MatchStrategy ¶
type MatchStrategy string
type Metadata ¶
type Metadata struct { RecordType string `json:"record_type,omitempty"` ZIPType string `json:"zip_type,omitempty"` CountyFIPS string `json:"county_fips,omitempty"` CountyName string `json:"county_name,omitempty"` CarrierRoute string `json:"carrier_route,omitempty"` CongressionalDistrict string `json:"congressional_district,omitempty"` BuildingDefaultIndicator string `json:"building_default_indicator,omitempty"` RDI string `json:"rdi,omitempty"` ELOTSequence string `json:"elot_sequence,omitempty"` ELOTSort string `json:"elot_sort,omitempty"` Latitude float64 `json:"latitude,omitempty"` Longitude float64 `json:"longitude,omitempty"` Precision string `json:"precision,omitempty"` TimeZone string `json:"time_zone,omitempty"` UTCOffset float32 `json:"utc_offset,omitempty"` DST bool `json:"dst,omitempty"` EWSMatch bool `json:"ews_match,omitempty"` }
Metadata contains all output fields defined here: https://smartystreets.com/docs/us-street-api#metadata