newInstrumentedTripper intercepts a http request, and increments the externalRequestCount metric.
(c *Config, source Oauth2Source, under http.RoundTripper)
| 267 | // newInstrumentedTripper intercepts a http request, and increments the |
| 268 | // externalRequestCount metric. |
| 269 | func newInstrumentedTripper(c *Config, source Oauth2Source, under http.RoundTripper) *instrumentedTripper { |
| 270 | if under == nil { |
| 271 | under = http.DefaultTransport |
| 272 | } |
| 273 | |
| 274 | return &instrumentedTripper{ |
| 275 | c: c, |
| 276 | source: source, |
| 277 | underlying: under, |
| 278 | } |
| 279 | } |
| 280 | |
| 281 | func (i *instrumentedTripper) RoundTrip(r *http.Request) (*http.Response, error) { |
| 282 | resp, err := i.underlying.RoundTrip(r) |
no outgoing calls
no test coverage detected