mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-09-18 03:22:22 +02:00
negentropy: refactor for allowing different types of storage.
This commit is contained in:
13
nip77/negentropy/storage.go
Normal file
13
nip77/negentropy/storage.go
Normal 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
|
||||
}
|
Reference in New Issue
Block a user