negentropy: refactor for allowing different types of storage.

This commit is contained in:
fiatjaf
2024-09-19 10:04:54 -03:00
parent 3d58ac5ec2
commit f94199cfc0
6 changed files with 59 additions and 63 deletions

View File

@@ -0,0 +1,13 @@
package negentropy
import (
"iter"
)
type Storage interface {
Size() int
Range(begin, end int) iter.Seq2[int, Item]
FindLowerBound(begin, end int, value Bound) int
GetBound(idx int) Bound
Fingerprint(begin, end int) [FingerprintSize]byte
}