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

Method Next

pkg/cache/postgres/object.go:152–164  ·  view source on GitHub ↗

Next retrieves the next encoded object, advancing the iterator.

()

Source from the content-addressed store, hash-verified

150
151// Next retrieves the next encoded object, advancing the iterator.
152func (iter *EncodedObjectIter) Next() (plumbing.EncodedObject, error) {
153 if len(iter.objects) == 0 && iter.moreData {
154 if err := iter.fetchNextBatch(); err != nil {
155 return nil, err
156 }
157 }
158 if len(iter.objects) > 0 {
159 obj := iter.objects[0]
160 iter.objects = iter.objects[1:]
161 return obj, nil
162 }
163 return nil, io.EOF
164}
165
166// ForEach implements the required method to iterate over each object.
167func (iter *EncodedObjectIter) ForEach(cb func(obj plumbing.EncodedObject) error) error {

Callers 1

ForEachMethod · 0.95

Calls 1

fetchNextBatchMethod · 0.95

Tested by

no test coverage detected