Documentation ¶
Index ¶
- func BuildInternationalAutocompleteAPIClient(options ...Option) *international_autocomplete.Client
- func BuildInternationalStreetAPIClient(options ...Option) *international_street.Client
- func BuildUSAutocompleteAPIClient(options ...Option) *autocomplete.Client
- func BuildUSAutocompleteProAPIClient(options ...Option) *autocomplete_pro.Client
- func BuildUSEnrichmentAPIClient(options ...Option) *us_enrichment.Client
- func BuildUSExtractAPIClient(options ...Option) *extract.Client
- func BuildUSReverseGeocodingAPIClient(options ...Option) *us_reverse_geo.Client
- func BuildUSStreetAPIClient(options ...Option) *street.Client
- func BuildUSZIPCodeAPIClient(options ...Option) *zipcode.Client
- type Option
- func CustomBaseURL(address string) Option
- func CustomHeader(key, value string) Option
- func DebugHTTPOutput() Option
- func DebugHTTPTracing() Option
- func DisableHTTP2() Option
- func DisableKeepAlive() Option
- func MaxRetry(retries int) Option
- func SecretKeyCredential(authID, authToken string) Option
- func Timeout(duration time.Duration) Option
- func ViaProxy(address string) Option
- func WebsiteKeyCredential(key, hostnameOrIP string) Option
- func WithHTTPClient(client *http.Client) Option
- func WithLicenses(licenses ...string) Option
- func WithMaxIdleConnections(max int) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildInternationalAutocompleteAPIClient ¶ added in v1.13.0
func BuildInternationalAutocompleteAPIClient(options ...Option) *international_autocomplete.Client
BuildInternationalAutocompleteAPIClient builds a client for the International Autocomplete API using the provided options.
func BuildInternationalStreetAPIClient ¶
func BuildInternationalStreetAPIClient(options ...Option) *international_street.Client
BuildInternationalStreetAPIClient builds a client for the International Street API using the provided options.
func BuildUSAutocompleteAPIClient ¶
func BuildUSAutocompleteAPIClient(options ...Option) *autocomplete.Client
BuildUSAutocompleteAPIClient builds a client for the US Autocomplete API using the provided options.
func BuildUSAutocompleteProAPIClient ¶ added in v1.10.0
func BuildUSAutocompleteProAPIClient(options ...Option) *autocomplete_pro.Client
BuildUSAutocompleteProAPIClient builds a client for the US Autocomplete API using the provided options.
func BuildUSEnrichmentAPIClient ¶ added in v1.17.0
func BuildUSEnrichmentAPIClient(options ...Option) *us_enrichment.Client
BuildUSEnrichmentAPIClient builds a client for the US Enrichment API using the provided options.
func BuildUSExtractAPIClient ¶
func BuildUSExtractAPIClient(options ...Option) *extract.Client
BuildUSExtractAPIClient builds a client for the US Extract API using the provided options.
func BuildUSReverseGeocodingAPIClient ¶ added in v1.8.0
func BuildUSReverseGeocodingAPIClient(options ...Option) *us_reverse_geo.Client
BuildUSReverseGeocodingAPIClient builds a client for the US Reverse Geocoding API using the provided options.
func BuildUSStreetAPIClient ¶
func BuildUSStreetAPIClient(options ...Option) *street.Client
BuildUSStreetAPIClient builds a client for the US Street API using the provided options.
func BuildUSZIPCodeAPIClient ¶
func BuildUSZIPCodeAPIClient(options ...Option) *zipcode.Client
BuildUSZIPCodeAPIClient builds a client for the US ZIP Code API using the provided options.
Types ¶
type Option ¶
type Option func(builder *clientBuilder)
func CustomBaseURL ¶
CustomBaseURL specifies the url that the client will use. In all but very few use cases the default value is sufficient and this method should not be called. The address provided will be consulted for scheme, host, and path values. Any other URL components such as the query string or fragment will be ignored.
func CustomHeader ¶
CustomHeader ensures the provided header is added to every API request made with the resulting client.
func DebugHTTPOutput ¶
func DebugHTTPOutput() Option
DebugHTTPOutput engages detailed HTTP request/response logging using functions from net/http/httputil.
func DebugHTTPTracing ¶
func DebugHTTPTracing() Option
DebugHTTPTracing engages additional HTTP-level tracing for each API request.
func DisableHTTP2 ¶ added in v1.1.0
func DisableHTTP2() Option
DisableHTTP2 prevents clients from making use of the http2 protocol. This is achieved by following the instructions from the http package documentation (see: https://golang.org/pkg/net/http): > "Programs that must disable HTTP/2 can do so by setting Transport.TLSNextProto to a non-nil, empty map."
func DisableKeepAlive ¶
func DisableKeepAlive() Option
DisableKeepAlive disables keep-alive for API requests. This is helpful if your environment limits the number of open files.
func MaxRetry ¶
MaxRetry specifies the number of times an API request will be resent in the case of network errors or unexpected results.
func SecretKeyCredential ¶
SecretKeyCredential sets the authID and authToken for use with the client. In all but very few cases calling this method with a valid authID and authToken is required.
func WebsiteKeyCredential ¶
WebsiteKeyCredential sets the key and hostnameOrIP for use with the client. This kind of authentication is generally only used for client-side applications but it included here for completeness.
func WithHTTPClient ¶ added in v1.4.0
WithHTTPClient allows the caller to supply their own *http.Client. This is useful if you want full control over the http client and its properties, but keep in mind that it reduces the following options to no-ops (you would need to specify any of those details on the *http.Client you provide):
- DisableHTTP2 - WithMaxIdleConnections - ViaProxy - Timeout
func WithLicenses ¶ added in v1.6.0
WithLicenses allows the caller to specify the subscription license (aka "track") they wish to use.
func WithMaxIdleConnections ¶
WithMaxIdleConnections sets MaxIdleConnsPerHost on the http.Transport used to send requests. Docs for http.Transport.MaxIdleConnsPerHost: https://golang.org/pkg/net/http/#Transport Also see: https://stackoverflow.com/questions/22881090/golang-about-maxidleconnsperhost-in-the-http-clients-transport