core: add flags to Storage.Find

It can be iterated over keys, values or both.
Prefix can be stripped.
This commit is contained in:
Evgeniy Stratonikov 2021-01-12 13:39:31 +03:00 committed by Roman Khimov
parent 2130e17f0c
commit 7fc0c04dba
8 changed files with 148 additions and 24 deletions

View file

@ -32,7 +32,7 @@ func Delete(key []byte) bool {
// Find returns an array of key-value pairs with key that matched the passed value
func Find(value []byte) []string {
iter := storage.Find(ctx, value)
iter := storage.Find(ctx, value, storage.None)
result := []string{}
for iterator.Next(iter) {
val := iterator.Value(iter).([]string)