Documentation ¶
Index ¶
- type BaseURLClient
- type CustomHeadersClient
- type DebugOutputClient
- type HTTPClient
- func NewDebugOutputClient(inner HTTPClient, dump bool) HTTPClient
- func NewKeepAliveCloseClient(client HTTPClient, close bool) HTTPClient
- func NewRetryClient(inner HTTPClient, maxRetries int, rand *rand.Rand, sleeper func(time.Duration)) HTTPClient
- func NewTracingClient(inner HTTPClient, trace bool) HTTPClient
- type HTTPSender
- type HTTPTraceLogger
- func (t *HTTPTraceLogger) AttachToRequest(request *http.Request) *http.Request
- func (t *HTTPTraceLogger) ConnectDone(network, address string, err error)
- func (t *HTTPTraceLogger) ConnectStart(network, address string)
- func (t *HTTPTraceLogger) DNSDone(info httptrace.DNSDoneInfo)
- func (t *HTTPTraceLogger) DNSStart(info httptrace.DNSStartInfo)
- func (t *HTTPTraceLogger) DumpResponse(response *http.Response, err error)
- func (t *HTTPTraceLogger) GetConn(hostPort string)
- func (t *HTTPTraceLogger) Got100Continue()
- func (t *HTTPTraceLogger) GotConn(info httptrace.GotConnInfo)
- func (t *HTTPTraceLogger) GotFirstResponseByte()
- func (t *HTTPTraceLogger) PutIdleConn(err error)
- func (t *HTTPTraceLogger) Wait100Continue()
- func (t *HTTPTraceLogger) WroteHeaders()
- func (t *HTTPTraceLogger) WroteRequest(info httptrace.WroteRequestInfo)
- type KeepAliveCloseClient
- type LicenseClient
- type NopCredential
- type RetryClient
- type SigningClient
- type TracingClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseURLClient ¶
type BaseURLClient struct {
// contains filtered or unexported fields
}
BaseURLClient amends the http.Request.URL with the configured scheme, host, and path. This comes in handy when calling an onsite installation of the us-street-api.
func NewBaseURLClient ¶
func NewBaseURLClient(inner HTTPClient, baseURL *url.URL) *BaseURLClient
type CustomHeadersClient ¶
type CustomHeadersClient struct {
// contains filtered or unexported fields
}
func NewCustomHeadersClient ¶
func NewCustomHeadersClient(inner HTTPClient, headers http.Header) *CustomHeadersClient
type DebugOutputClient ¶
type DebugOutputClient struct {
// contains filtered or unexported fields
}
DebugOutputClient makes use of functions from net/http/httputil to log http request/response details.
type HTTPClient ¶
HTTPClient matches http.Client and allows us to define custom clients that wrap over http.Client.
func NewDebugOutputClient ¶
func NewDebugOutputClient(inner HTTPClient, dump bool) HTTPClient
func NewKeepAliveCloseClient ¶
func NewKeepAliveCloseClient(client HTTPClient, close bool) HTTPClient
func NewRetryClient ¶
func NewRetryClient(inner HTTPClient, maxRetries int, rand *rand.Rand, sleeper func(time.Duration)) HTTPClient
func NewTracingClient ¶
func NewTracingClient(inner HTTPClient, trace bool) HTTPClient
type HTTPSender ¶
type HTTPSender struct {
// contains filtered or unexported fields
}
HTTPSender translates *http.Request into ([]byte, error) by - calling the provided HTTPClient, - reading the response body, and - interpreting the content (or error) received.
func NewHTTPSender ¶
func NewHTTPSender(client HTTPClient) *HTTPSender
type HTTPTraceLogger ¶
func NewHTTPTraceLogger ¶
func NewHTTPTraceLogger() *HTTPTraceLogger
func (*HTTPTraceLogger) AttachToRequest ¶
func (t *HTTPTraceLogger) AttachToRequest(request *http.Request) *http.Request
func (*HTTPTraceLogger) ConnectDone ¶
func (t *HTTPTraceLogger) ConnectDone(network, address string, err error)
func (*HTTPTraceLogger) ConnectStart ¶
func (t *HTTPTraceLogger) ConnectStart(network, address string)
func (*HTTPTraceLogger) DNSDone ¶
func (t *HTTPTraceLogger) DNSDone(info httptrace.DNSDoneInfo)
func (*HTTPTraceLogger) DNSStart ¶
func (t *HTTPTraceLogger) DNSStart(info httptrace.DNSStartInfo)
func (*HTTPTraceLogger) DumpResponse ¶
func (t *HTTPTraceLogger) DumpResponse(response *http.Response, err error)
func (*HTTPTraceLogger) GetConn ¶
func (t *HTTPTraceLogger) GetConn(hostPort string)
func (*HTTPTraceLogger) Got100Continue ¶
func (t *HTTPTraceLogger) Got100Continue()
func (*HTTPTraceLogger) GotConn ¶
func (t *HTTPTraceLogger) GotConn(info httptrace.GotConnInfo)
func (*HTTPTraceLogger) GotFirstResponseByte ¶
func (t *HTTPTraceLogger) GotFirstResponseByte()
func (*HTTPTraceLogger) PutIdleConn ¶
func (t *HTTPTraceLogger) PutIdleConn(err error)
func (*HTTPTraceLogger) Wait100Continue ¶
func (t *HTTPTraceLogger) Wait100Continue()
func (*HTTPTraceLogger) WroteHeaders ¶
func (t *HTTPTraceLogger) WroteHeaders()
func (*HTTPTraceLogger) WroteRequest ¶
func (t *HTTPTraceLogger) WroteRequest(info httptrace.WroteRequestInfo)
type KeepAliveCloseClient ¶
type KeepAliveCloseClient struct {
// contains filtered or unexported fields
}
type LicenseClient ¶ added in v1.6.0
type LicenseClient struct {
// contains filtered or unexported fields
}
func NewLicenseClient ¶ added in v1.6.0
func NewLicenseClient(inner HTTPClient, licenses ...string) *LicenseClient
type NopCredential ¶
type NopCredential struct{}
NopCredential - See https://en.wikipedia.org/wiki/Null_Object_pattern
type RetryClient ¶
type RetryClient struct {
// contains filtered or unexported fields
}
RetryClient sends failed requests multiple times depending on the parameters passed to NewRetryClient.
type SigningClient ¶
type SigningClient struct {
// contains filtered or unexported fields
}
Signing client signs each request it receives using the credential provided and forwards the request to the inner client.
func NewSigningClient ¶
func NewSigningClient(inner HTTPClient, credential sdk.Credential) *SigningClient
type TracingClient ¶
type TracingClient struct {
// contains filtered or unexported fields
}