MCPcopy
hub / github.com/canopy-network/canopy / Iterator

Method Iterator

store/txn.go:160–166  ·  view source on GitHub ↗

Iterator() returns a new iterator for merged iteration of both the in-memory operations and parent store with the given prefix

(prefix []byte)

Source from the content-addressed store, hash-verified

158
159// Iterator() returns a new iterator for merged iteration of both the in-memory operations and parent store with the given prefix
160func (t *Txn) Iterator(prefix []byte) (lib.IteratorI, lib.ErrorI) {
161 it, err := t.reader.NewIterator(lib.Append(t.prefix, prefix), false, t.seek)
162 if err != nil {
163 return nil, err
164 }
165 return newTxnIterator(it, t.txn.copy(), prefix, t.prefix, false), nil
166}
167
168// RevIterator() returns a new reverse iterator for merged iteration of both the in-memory operations and parent store with the given prefix
169func (t *Txn) RevIterator(prefix []byte) (lib.IteratorI, lib.ErrorI) {

Callers

nothing calls this directly

Calls 4

AppendFunction · 0.92
newTxnIteratorFunction · 0.85
NewIteratorMethod · 0.65
copyMethod · 0.45

Tested by

no test coverage detected