(ctx context.Context, mediaType string)
| 88 | } |
| 89 | |
| 90 | func 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 |
| 115 | func NewProcessorChain(mt string, r io.Reader) StreamProcessor { |
nothing calls this directly
no test coverage detected
searching dependent graphs…