MCPcopy Index your code
hub / github.com/docker/docker-agent / TracedClient

Function TracedClient

pkg/httpclient/client.go:103–109  ·  view source on GitHub ↗

TracedClient returns a configurable `http.Client` with the default transport already wrapped via `WrapWithOTel`. The supplied options (timeout, redirect policy, jar, etc.) are applied after construction. Convenience wrapper for short-lived clients with custom timeouts.

(opts ...func(*http.Client))

Source from the content-addressed store, hash-verified

101// (timeout, redirect policy, jar, etc.) are applied after construction.
102// Convenience wrapper for short-lived clients with custom timeouts.
103func TracedClient(opts ...func(*http.Client)) *http.Client {
104 c := &http.Client{Transport: WrapWithOTel(http.DefaultTransport)}
105 for _, opt := range opts {
106 opt(c)
107 }
108 return c
109}
110
111func WithHeader(key, value string) Opt {
112 return func(o *HTTPOptions) {

Callers

nothing calls this directly

Calls 1

WrapWithOTelFunction · 0.85

Tested by

no test coverage detected