database/searcher.go

14 lines
633 B
Go
Raw Normal View History

2022-01-09 03:01:15 +00:00
package database
// Searcher must be able to search through our datastore(s) with strings.
type Searcher interface {
2022-01-19 09:46:51 +00:00
// AllKeys must retrieve all keys in the datastore with the given storeName.
2022-01-09 03:01:15 +00:00
AllKeys() []string
// PrefixScan must return all keys that begin with the given prefix.
PrefixScan(prefix string) map[string]interface{}
// Search must be able to search through the contents of our database and return a map of results.
Search(query string) map[string]interface{}
// ValueExists searches for an exact match of the given value and returns the key that contains it.
ValueExists(value []byte) (key []byte, ok bool)
}