MCPcopy
hub / github.com/kopia/kopia / newZstdCompressor

Function newZstdCompressor

repo/compression/compressor_zstd.go:21–30  ·  view source on GitHub ↗
(id HeaderID, level zstd.EncoderLevel)

Source from the content-addressed store, hash-verified

19}
20
21func newZstdCompressor(id HeaderID, level zstd.EncoderLevel) Compressor {
22 return &zstdCompressor{id, compressionHeader(id), sync.Pool{
23 New: func() any {
24 w, err := zstd.NewWriter(io.Discard, zstd.WithEncoderLevel(level))
25 mustSucceed(err)
26
27 return w
28 },
29 }}
30}
31
32type zstdCompressor struct {
33 id HeaderID

Callers 1

initFunction · 0.85

Calls 3

compressionHeaderFunction · 0.85
mustSucceedFunction · 0.85
NewWriterMethod · 0.65

Tested by

no test coverage detected