MCPcopy
hub / github.com/containerd/containerd / Walk

Method Walk

core/snapshots/proxy/proxy.go:157–182  ·  view source on GitHub ↗
(ctx context.Context, fn snapshots.WalkFunc, fs ...string)

Source from the content-addressed store, hash-verified

155}
156
157func (p *proxySnapshotter) Walk(ctx context.Context, fn snapshots.WalkFunc, fs ...string) error {
158 sc, err := p.client.List(ctx, &snapshotsapi.ListSnapshotsRequest{
159 Snapshotter: p.snapshotterName,
160 Filters: fs,
161 })
162 if err != nil {
163 return errgrpc.ToNative(err)
164 }
165 for {
166 resp, err := sc.Recv()
167 if err != nil {
168 if err == io.EOF {
169 return nil
170 }
171 return errgrpc.ToNative(err)
172 }
173 if resp == nil {
174 return nil
175 }
176 for _, info := range resp.Info {
177 if err := fn(ctx, InfoFromProto(info)); err != nil {
178 return err
179 }
180 }
181 }
182}
183
184func (p *proxySnapshotter) Close() error {
185 return nil

Callers

nothing calls this directly

Calls 3

InfoFromProtoFunction · 0.85
ListMethod · 0.65
RecvMethod · 0.65

Tested by

no test coverage detected