bring in khatru and eventstore.

This commit is contained in:
fiatjaf
2025-04-15 08:49:28 -03:00
parent 8466a9757b
commit 76032dc089
170 changed files with 15018 additions and 42 deletions

View File

@@ -0,0 +1,24 @@
package skipevent
import (
"context"
"github.com/fiatjaf/eventstore"
"github.com/nbd-wtf/go-nostr"
)
type Wrapper struct {
eventstore.Store
Skip func(ctx context.Context, evt *nostr.Event) bool
}
var _ eventstore.Store = (*Wrapper)(nil)
func (w Wrapper) SaveEvent(ctx context.Context, evt *nostr.Event) error {
if w.Skip(ctx, evt) {
return nil
}
return w.Store.SaveEvent(ctx, evt)
}