wireup

package
v1.15.5 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: Apache-2.0 Imports: 17 Imported by: 8

Documentation

Index

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 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

func CustomBaseURL(address string) Option

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

func CustomHeader(key, value string) Option

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

func MaxRetry(retries int) Option

MaxRetry specifies the number of times an API request will be resent in the case of network errors or unexpected results.

func SecretKeyCredential

func SecretKeyCredential(authID, authToken string) Option

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 Timeout

func Timeout(duration time.Duration) Option

Timeout specifies the timeout for all API requests.

func ViaProxy

func ViaProxy(address string) Option

ViaProxy saves the address of your proxy server through which to send all requests.

func WebsiteKeyCredential

func WebsiteKeyCredential(key, hostnameOrIP string) Option

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

func WithHTTPClient(client *http.Client) Option

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

func WithLicenses(licenses ...string) Option

WithLicenses allows the caller to specify the subscription license (aka "track") they wish to use.

func WithMaxIdleConnections

func WithMaxIdleConnections(max int) Option

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

Jump to

Keyboard shortcuts

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