MCPcopy
hub / github.com/containerd/containerd / GetProcessor

Function GetProcessor

core/diff/stream.go:49–58  ·  view source on GitHub ↗

GetProcessor returns the processor for a media-type

(ctx context.Context, stream StreamProcessor, payloads map[string]typeurl.Any)

Source from the content-addressed store, hash-verified

47
48// GetProcessor returns the processor for a media-type
49func GetProcessor(ctx context.Context, stream StreamProcessor, payloads map[string]typeurl.Any) (StreamProcessor, error) {
50 // reverse this list so that user configured handlers come up first
51 for i := len(handlers) - 1; i >= 0; i-- {
52 processor, ok := handlers[i](ctx, stream.MediaType())
53 if ok {
54 return processor(ctx, stream, payloads)
55 }
56 }
57 return nil, ErrNoProcessor
58}
59
60// Handler checks a media-type and initializes the processor
61type Handler func(ctx context.Context, mediaType string) (StreamProcessorInit, bool)

Callers 5

ApplyMethod · 0.92
ApplyMethod · 0.92
applyCIMLayerCommonFunction · 0.92
ApplyMethod · 0.92
ApplyMethod · 0.92

Calls 1

MediaTypeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…