WrapResponseWriter is a proxy around an http.ResponseWriter that allows you to hook into various parts of the response process.
| 46 | // WrapResponseWriter is a proxy around an http.ResponseWriter that allows you to hook |
| 47 | // into various parts of the response process. |
| 48 | type WrapResponseWriter interface { |
| 49 | http.ResponseWriter |
| 50 | // Status returns the HTTP status of the request, or 0 if one has not |
| 51 | // yet been sent. |
| 52 | Status() int |
| 53 | // BytesWritten returns the total number of bytes sent to the client. |
| 54 | BytesWritten() int |
| 55 | // Tee causes the response body to be written to the given io.Writer in |
| 56 | // addition to proxying the writes through. Only one io.Writer can be |
| 57 | // tee'd to at once: setting a second one will overwrite the first. |
| 58 | // Writes will be sent to the proxy before being written to this |
| 59 | // io.Writer. It is illegal for the tee'd writer to be modified |
| 60 | // concurrently with writes. |
| 61 | Tee(io.Writer) |
| 62 | // Unwrap returns the original proxied target. |
| 63 | Unwrap() http.ResponseWriter |
| 64 | // Discard causes all writes to the original ResponseWriter be discarded, |
| 65 | // instead writing only to the tee'd writer if it's set. |
| 66 | // The caller is responsible for calling WriteHeader and Write on the |
| 67 | // original ResponseWriter once the processing is done. |
| 68 | Discard() |
| 69 | } |
| 70 | |
| 71 | // basicWriter wraps a http.ResponseWriter that implements the minimal |
| 72 | // http.ResponseWriter interface. |
no outgoing calls
no test coverage detected