MCPcopy Create free account
hub / github.com/ChainSafe/nodewatch-api / StreamChunk

Function StreamChunk

crawler/rpc/request/encode.go:117–122  ·  view source on GitHub ↗

StreamChunk reads (decompressed) response message from the msg io.Reader, and writes it as a chunk with given result code to the output writer. The compression is optional and may be nil.

(result ResponseCode, size uint64, r io.Reader, w io.Writer, comp Compression)

Source from the content-addressed store, hash-verified

115// StreamChunk reads (decompressed) response message from the msg io.Reader,
116// and writes it as a chunk with given result code to the output writer. The compression is optional and may be nil.
117func StreamChunk(result ResponseCode, size uint64, r io.Reader, w io.Writer, comp Compression) error {
118 if err := EncodeResult(result, w); err != nil {
119 return err
120 }
121 return StreamHeaderAndPayload(size, r, w, comp)
122}

Callers 4

WriteResponseChunkMethod · 0.85
WriteRawResponseChunkMethod · 0.85
StreamResponseChunkMethod · 0.85
WriteErrorChunkMethod · 0.85

Calls 2

EncodeResultFunction · 0.85
StreamHeaderAndPayloadFunction · 0.85

Tested by

no test coverage detected