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

Method Get

index/index.go:71–80  ·  view source on GitHub ↗

Get returns the value of `key` which is found by `SlimIndex.DataReader`, and a bool value indicating if the `key` is found or not.

(key string)

Source from the content-addressed store, hash-verified

69// Get returns the value of `key` which is found by `SlimIndex.DataReader`, and
70// a bool value indicating if the `key` is found or not.
71func (si *SlimIndex) Get(key string) (string, bool) {
72 o, found := si.SlimTrie.Get(key)
73 if !found {
74 return "", false
75 }
76
77 offset := o.(int64)
78
79 return si.DataReader.Read(offset, key)
80}
81
82// RangeGet returns the value of `key` that is contained in a range,
83// and a bool value indicating if the `key` is found or not.

Callers 2

TestSlimIndexFunction · 0.95
ExampleFunction · 0.95

Calls 1

ReadMethod · 0.65

Tested by 2

TestSlimIndexFunction · 0.76
ExampleFunction · 0.76