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))
| 101 | // (timeout, redirect policy, jar, etc.) are applied after construction. |
| 102 | // Convenience wrapper for short-lived clients with custom timeouts. |
| 103 | func 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 | |
| 111 | func WithHeader(key, value string) Opt { |
| 112 | return func(o *HTTPOptions) { |
nothing calls this directly
no test coverage detected