Skip to content

Commit

Permalink
badger: ok, now BadgerBackend has to be passed as a pointer everywhere.
Browse files Browse the repository at this point in the history
  • Loading branch information
fiatjaf committed Oct 8, 2024
1 parent 51bd05f commit 8a3fc41
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion badger/count.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/nbd-wtf/go-nostr"
)

func (b BadgerBackend) CountEvents(ctx context.Context, filter nostr.Filter) (int64, error) {
func (b *BadgerBackend) CountEvents(ctx context.Context, filter nostr.Filter) (int64, error) {
var count int64 = 0

queries, extraFilter, since, err := prepareQueries(filter)
Expand Down
2 changes: 1 addition & 1 deletion badger/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func getTagIndexPrefix(tagValue string) ([]byte, int) {
return k, offset
}

func (b BadgerBackend) getIndexKeysForEvent(evt *nostr.Event, idx []byte) iter.Seq[[]byte] {
func (b *BadgerBackend) getIndexKeysForEvent(evt *nostr.Event, idx []byte) iter.Seq[[]byte] {
return func(yield func([]byte) bool) {
{
// ~ by id
Expand Down
2 changes: 1 addition & 1 deletion badger/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type iterEvent struct {

var BatchFilled = errors.New("batch-filled")

func (b BadgerBackend) QueryEvents(ctx context.Context, filter nostr.Filter) (chan *nostr.Event, error) {
func (b *BadgerBackend) QueryEvents(ctx context.Context, filter nostr.Filter) (chan *nostr.Event, error) {
ch := make(chan *nostr.Event)

if filter.Search != "" {
Expand Down

0 comments on commit 8a3fc41

Please sign in to comment.