NewClient creates a Client with tracing support.
(tracer opentracing.Tracer, options ...Option)
| 57 | |
| 58 | // NewClient creates a Client with tracing support. |
| 59 | func NewClient(tracer opentracing.Tracer, options ...Option) *Client { |
| 60 | baseClient := &http.Client{Transport: &nethttp.Transport{}} |
| 61 | c := &Client{ |
| 62 | tracer: tracer, |
| 63 | underlying: baseClient, |
| 64 | requestLogThreshold: 5000, |
| 65 | responseLogThreshold: 5000, |
| 66 | } |
| 67 | for _, f := range options { |
| 68 | f(c) |
| 69 | } |
| 70 | return c |
| 71 | } |
| 72 | |
| 73 | // Do sends the request. |
| 74 | func (c *Client) Do(req *http.Request) (*http.Response, error) { |
no outgoing calls