NewResponse returns a new Response instance with config. Requirements for config are same as for WithConfig function. If response is nil, failure is reported. If rtt is given, it defines response round-trip time to be reported by response.RoundTripTime().
( config Config, response *http.Response, rtt ...time.Duration, )
| 77 | // If rtt is given, it defines response round-trip time to be reported |
| 78 | // by response.RoundTripTime(). |
| 79 | func NewResponseC( |
| 80 | config Config, response *http.Response, rtt ...time.Duration, |
| 81 | ) *Response { |
| 82 | config = config.withDefaults() |
| 83 | |
| 84 | return newResponse(responseOpts{ |
| 85 | config: config, |
| 86 | chain: newChainWithConfig("Response()", config), |
| 87 | httpResp: response, |
| 88 | rtt: rtt, |
| 89 | }) |
| 90 | } |
| 91 | |
| 92 | type responseOpts struct { |
| 93 | config Config |
searching dependent graphs…