Documentation ¶
Index ¶
- func BuildInternationalStreetAPIClient(options ...Option) *international_street.Client
- func BuildUSAutocompleteAPIClient(options ...Option) *autocomplete.Client
- func BuildUSExtractAPIClient(options ...Option) *extract.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 WithMaxIdleConnections(max int) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 BuildUSExtractAPIClient ¶
func BuildUSExtractAPIClient(options ...Option) *extract.Client
BuildUSExtractAPIClient builds a client for the US Extract 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 should be a url that consists of only the scheme and host. Any other elements (such as a path, 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 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