MCPcopy Create free account
hub / github.com/imroc/req / NewCompressReader

Function NewCompressReader

internal/compress/reader.go:11–23  ·  view source on GitHub ↗
(body io.ReadCloser, contentEncoding string)

Source from the content-addressed store, hash-verified

9}
10
11func NewCompressReader(body io.ReadCloser, contentEncoding string) CompressReader {
12 switch contentEncoding {
13 case "gzip":
14 return NewGzipReader(body)
15 case "deflate":
16 return NewDeflateReader(body)
17 case "br":
18 return NewBrotliReader(body)
19 case "zstd":
20 return NewZstdReader(body)
21 }
22 return nil
23}

Callers 4

readLoopMethod · 0.92
handleResponseMethod · 0.92
ReadResponseMethod · 0.92
TestNewCompressReaderFunction · 0.85

Calls 4

NewGzipReaderFunction · 0.85
NewDeflateReaderFunction · 0.85
NewBrotliReaderFunction · 0.85
NewZstdReaderFunction · 0.85

Tested by 1

TestNewCompressReaderFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…