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

Method Next

pkg/cache/postgres/reference.go:165–177  ·  view source on GitHub ↗

Next retrieves the next reference, advancing the iterator.

()

Source from the content-addressed store, hash-verified

163
164// Next retrieves the next reference, advancing the iterator.
165func (iter *ReferenceIter) Next() (*plumbing.Reference, error) {
166 if len(iter.refs) == 0 && iter.moreData {
167 if err := iter.fetchNextBatch(); err != nil {
168 return nil, err
169 }
170 }
171 if len(iter.refs) > 0 {
172 ref := iter.refs[0]
173 iter.refs = iter.refs[1:]
174 return ref, nil
175 }
176 return nil, io.EOF
177}
178
179// ForEach implements the required method to iterate over each reference.
180func (iter *ReferenceIter) ForEach(cb func(obj *plumbing.Reference) error) error {

Callers 1

ForEachMethod · 0.95

Calls 1

fetchNextBatchMethod · 0.95

Tested by

no test coverage detected