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

Function EncodeChunk

crawler/rpc/request/encode.go:108–113  ·  view source on GitHub ↗

EncodeChunk 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, r io.Reader, w io.Writer, comp Compression)

Source from the content-addressed store, hash-verified

106// EncodeChunk reads (decompressed) response message from the msg io.Reader,
107// and writes it as a chunk with given result code to the output writer. The compression is optional and may be nil.
108func EncodeChunk(result ResponseCode, r io.Reader, w io.Writer, comp Compression) error {
109 if err := EncodeResult(result, w); err != nil {
110 return err
111 }
112 return EncodeHeaderAndPayload(r, w, comp)
113}
114
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.

Callers

nothing calls this directly

Calls 2

EncodeResultFunction · 0.85
EncodeHeaderAndPayloadFunction · 0.85

Tested by

no test coverage detected