wait, Querier can just return an iter like eventstore, it's ok.

This commit is contained in:
fiatjaf
2025-04-16 03:06:27 -03:00
parent 5b8954461f
commit f7884cea4f
4 changed files with 17 additions and 49 deletions

View File

@@ -1,26 +0,0 @@
package wrappers
import (
"context"
"fiatjaf.com/nostr"
"fiatjaf.com/nostr/eventstore"
)
var _ nostr.Querier = StoreQuerier{}
type StoreQuerier struct {
eventstore.Store
}
func (w StoreQuerier) QueryEvents(ctx context.Context, filter nostr.Filter) (chan nostr.Event, error) {
ch := make(chan nostr.Event)
go func() {
for evt := range w.Store.QueryEvents(filter) {
ch <- evt
}
}()
return ch, nil
}