MCPcopy Create free account
hub / github.com/encoder-run/operator / ForEach

Method ForEach

pkg/cache/redis/reference.go:205–224  ·  view source on GitHub ↗
(cb func(obj *plumbing.Reference) error)

Source from the content-addressed store, hash-verified

203}
204
205func (iter *ReferenceIter) ForEach(cb func(obj *plumbing.Reference) error) error {
206 for {
207 obj, err := iter.Next()
208 if err != nil {
209 if err == io.EOF {
210 return nil
211 }
212
213 return err
214 }
215
216 if err := cb(obj); err != nil {
217 if err == storer.ErrStop {
218 return nil
219 }
220
221 return err
222 }
223 }
224}
225
226// Close is a placeholder to satisfy the ReferenceIter interface.
227// Redis connections are managed outside the iterator, so there's nothing to close here.

Callers

nothing calls this directly

Calls 1

NextMethod · 0.95

Tested by

no test coverage detected