MCPcopy
hub / github.com/rs/zerolog / WriterProxy

Interface WriterProxy

hlog/internal/mutil/writer_proxy.go:12–28  ·  hlog/internal/mutil/writer_proxy.go::WriterProxy

WriterProxy is a proxy around an http.ResponseWriter that allows you to hook into various parts of the response process.

Source from the content-addressed store, hash-verified

10// WriterProxy is a proxy around an http.ResponseWriter that allows you to hook
11// into various parts of the response process.
12type 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.

Callers 3

AccessHandlerFunction · 0.65
AccessHandlerFunction · 0.65
MarshalStackFunction · 0.65

Implementers 1

basicWriterhlog/internal/mutil/writer_proxy.go

Calls

no outgoing calls

Tested by

no test coverage detected