-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.go
More file actions
30 lines (23 loc) · 736 Bytes
/
index.go
File metadata and controls
30 lines (23 loc) · 736 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package diff
// Indexer represents indexing functions
type Indexer interface {
// Index records new values and ONE new resume key value (if given).
// If resumeKey is not nil, a value is expected.
Index(kvs <-chan KeyValue, resumeKey <-chan []byte) error
// ResumeKey returns the current resume key value
ResumeKey() ([]byte, error)
}
type SyncIndex interface {
Cleanup() error
Compare(kv KeyValue) (CompareResult, error)
Value(key []byte) []byte
KeyValues() <-chan KeyValue
DoesRecordValues() bool
// KeysNotSeen streams the keys that were not seen in the previous Compare calls.
// Return nil if the index did not record this information.
KeysNotSeen() <-chan []byte
}
type Index interface {
Indexer
SyncIndex
}