DataReader defines interface to let SlimIndex access the data it indexes.
| 18 | |
| 19 | // DataReader defines interface to let SlimIndex access the data it indexes. |
| 20 | type DataReader interface { |
| 21 | // Read value at `offset`, of `key`. |
| 22 | // Because the internal SlimTrie does not store complete info of a key(to |
| 23 | // reduce memory consumption). |
| 24 | // Thus the offset SlimTrie returns might not be correct for an abscent |
| 25 | // record. |
| 26 | // It is data providers' responsibility to check if the record at `offset` |
| 27 | // has the exact `key`. |
| 28 | Read(offset int64, key string) (string, bool) |
| 29 | } |
| 30 | |
| 31 | // OffsetIndexItem defines data types for a offset-based index, such as an index |
| 32 | // of on-disk records. |