64KB maximum chunk size StreamingResponseWriter implements http.ResponseWriter interface to stream response data through a channel rather than buffering it in memory. This is particularly useful for handling large responses like video streams or file downloads.
| 16 | // data through a channel rather than buffering it in memory. This is particularly |
| 17 | // useful for handling large responses like video streams or file downloads. |
| 18 | type StreamingResponseWriter struct { |
| 19 | header http.Header |
| 20 | statusCode int |
| 21 | respChan chan<- wshrpc.RespOrErrorUnion[wshrpc.VDomUrlRequestResponse] |
| 22 | headerSent bool |
| 23 | buffer *bytes.Buffer |
| 24 | } |
| 25 | |
| 26 | func NewStreamingResponseWriter(respChan chan<- wshrpc.RespOrErrorUnion[wshrpc.VDomUrlRequestResponse]) *StreamingResponseWriter { |
| 27 | return &StreamingResponseWriter{ |
nothing calls this directly
no outgoing calls
no test coverage detected