WriterProxy is a proxy around an http.ResponseWriter that allows you to hook into various parts of the response process.
| 10 | // WriterProxy is a proxy around an http.ResponseWriter that allows you to hook |
| 11 | // into various parts of the response process. |
| 12 | type WriterProxy interface { |
| 13 | http.ResponseWriter |
| 14 | // Status returns the HTTP status of the request, or 0 if one has not |
| 15 | // yet been sent. |
| 16 | Status() int |
| 17 | // BytesWritten returns the total number of bytes sent to the client. |
| 18 | BytesWritten() int |
| 19 | // Tee causes the response body to be written to the given io.Writer in |
| 20 | // addition to proxying the writes through. Only one io.Writer can be |
| 21 | // tee'd to at once: setting a second one will overwrite the first. |
| 22 | // Writes will be sent to the proxy before being written to this |
| 23 | // io.Writer. It is illegal for the tee'd writer to be modified |
| 24 | // concurrently with writes. |
| 25 | Tee(io.Writer) |
| 26 | // Unwrap returns the original proxied target. |
| 27 | Unwrap() http.ResponseWriter |
| 28 | } |
| 29 | |
| 30 | // WrapWriter wraps an http.ResponseWriter, returning a proxy that allows you to |
| 31 | // hook into various parts of the response process. |
no outgoing calls
no test coverage detected