MCPcopy
hub / github.com/containerd/containerd / compressedHandler

Function compressedHandler

core/diff/stream.go:90–112  ·  view source on GitHub ↗
(ctx context.Context, mediaType string)

Source from the content-addressed store, hash-verified

88}
89
90func compressedHandler(ctx context.Context, mediaType string) (StreamProcessorInit, bool) {
91 compressed, err := images.DiffCompression(ctx, mediaType)
92 if err != nil {
93 return nil, false
94 }
95 if compressed != "" {
96 return func(ctx context.Context, stream StreamProcessor, payloads map[string]typeurl.Any) (StreamProcessor, error) {
97 ds, err := compression.DecompressStream(stream)
98 if err != nil {
99 return nil, err
100 }
101
102 return &compressedProcessor{
103 rc: ds,
104 }, nil
105 }, true
106 }
107 return func(ctx context.Context, stream StreamProcessor, payloads map[string]typeurl.Any) (StreamProcessor, error) {
108 return &stdProcessor{
109 rc: stream,
110 }, nil
111 }, true
112}
113
114// NewProcessorChain initialized the root StreamProcessor
115func NewProcessorChain(mt string, r io.Reader) StreamProcessor {

Callers

nothing calls this directly

Calls 2

DiffCompressionFunction · 0.92
DecompressStreamFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…