wireup

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2019 License: Apache-2.0 Imports: 12 Imported by: 8

Documentation

Index

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

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

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