IterReferences returns an iterator for references stored in Redis.
()
| 150 | |
| 151 | // IterReferences returns an iterator for references stored in Redis. |
| 152 | func (r *ReferenceStorage) IterReferences() (storer.ReferenceIter, error) { |
| 153 | // Initialize the iterator |
| 154 | iter := &ReferenceIter{ |
| 155 | client: r.client, |
| 156 | namespacePrefix: r.namespacePrefix, |
| 157 | cursor: 0, |
| 158 | keys: nil, |
| 159 | moreData: true, // Assume there's more data until proven otherwise |
| 160 | } |
| 161 | // Perform the initial scan |
| 162 | iter.fetchNextBatch() |
| 163 | return iter, nil |
| 164 | } |
| 165 | |
| 166 | // fetchNextBatch fetches the next batch of keys from Redis matching the pattern "ref:*". |
| 167 | func (iter *ReferenceIter) fetchNextBatch() { |
nothing calls this directly
no test coverage detected