MCPcopy
hub / github.com/openacid/slim / DataReader

Interface DataReader

index/index.go:20–29  ·  view source on GitHub ↗

DataReader defines interface to let SlimIndex access the data it indexes.

Source from the content-addressed store, hash-verified

18
19// DataReader defines interface to let SlimIndex access the data it indexes.
20type 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.

Callers 3

DecodeMethod · 0.65
GetMethod · 0.65
RangeGetMethod · 0.65

Calls

no outgoing calls

Tested by

no test coverage detected