(downstreamURL string, transport http.RoundTripper)
| 15 | } |
| 16 | |
| 17 | func NewDownstreamRoundTripper(downstreamURL string, transport http.RoundTripper) (http.RoundTripper, error) { |
| 18 | u, err := url.Parse(downstreamURL) |
| 19 | if err != nil { |
| 20 | return nil, err |
| 21 | } |
| 22 | |
| 23 | return &downstreamRoundTripper{downstreamURL: u, transport: transport}, nil |
| 24 | } |
| 25 | |
| 26 | func (d downstreamRoundTripper) RoundTrip(r *http.Request) (*http.Response, error) { |
| 27 | tracer, span := opentracing.GlobalTracer(), opentracing.SpanFromContext(r.Context()) |