nip77: FetchIDsOnly()
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package vector
|
||||
package storage
|
||||
|
||||
import (
|
||||
"crypto/sha256"
|
||||
28
nip77/negentropy/storage/empty/empty.go
Normal file
28
nip77/negentropy/storage/empty/empty.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package empty
|
||||
|
||||
import (
|
||||
"iter"
|
||||
|
||||
"github.com/nbd-wtf/go-nostr/nip77/negentropy"
|
||||
"github.com/nbd-wtf/go-nostr/nip77/negentropy/storage"
|
||||
)
|
||||
|
||||
var acc storage.Accumulator
|
||||
|
||||
type Empty struct{}
|
||||
|
||||
func (Empty) Size() int { return 0 }
|
||||
|
||||
func (Empty) Range(begin, end int) iter.Seq2[int, negentropy.Item] {
|
||||
return func(yield func(int, negentropy.Item) bool) {}
|
||||
}
|
||||
|
||||
func (Empty) FindLowerBound(begin, end int, value negentropy.Bound) int { return begin }
|
||||
|
||||
func (Empty) GetBound(idx int) negentropy.Bound {
|
||||
return negentropy.InfiniteBound
|
||||
}
|
||||
|
||||
func (Empty) Fingerprint(begin, end int) string {
|
||||
return acc.GetFingerprint(end - begin)
|
||||
}
|
||||
@@ -8,13 +8,14 @@ import (
|
||||
|
||||
"github.com/nbd-wtf/go-nostr"
|
||||
"github.com/nbd-wtf/go-nostr/nip77/negentropy"
|
||||
"github.com/nbd-wtf/go-nostr/nip77/negentropy/storage"
|
||||
)
|
||||
|
||||
type Vector struct {
|
||||
items []negentropy.Item
|
||||
sealed bool
|
||||
|
||||
acc Accumulator
|
||||
acc storage.Accumulator
|
||||
}
|
||||
|
||||
func New() *Vector {
|
||||
|
||||
Reference in New Issue
Block a user