MCPcopy
hub / github.com/wavetermdev/waveterm / StreamingResponseWriter

Struct StreamingResponseWriter

pkg/waveapp/streamingresp.go:18–24  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

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.
18type 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
26func NewStreamingResponseWriter(respChan chan<- wshrpc.RespOrErrorUnion[wshrpc.VDomUrlRequestResponse]) *StreamingResponseWriter {
27 return &StreamingResponseWriter{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected