mongo

package
v0.16.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2025 License: Unlicense Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTooManyIDs       = errors.New("too many ids")
	ErrTooManyAuthors   = errors.New("too many authors")
	ErrTooManyKinds     = errors.New("too many kinds")
	ErrEmptyTagSet      = errors.New("empty tag set")
	ErrTooManyTagValues = errors.New("too many tag values")
)

Functions

This section is empty.

Types

type MongoDBBackend

type MongoDBBackend struct {
	sync.Mutex
	*mongo.Client

	DatabaseURL       string
	QueryLimit        int
	QueryIDsLimit     int
	QueryAuthorsLimit int
	QueryKindsLimit   int
	QueryTagsLimit    int
	// contains filtered or unexported fields
}

func (*MongoDBBackend) Close

func (m *MongoDBBackend) Close()

func (*MongoDBBackend) CountEvents

func (m *MongoDBBackend) CountEvents(ctx context.Context, filter nostr.Filter) (int64, error)

func (*MongoDBBackend) DeleteEvent

func (m *MongoDBBackend) DeleteEvent(ctx context.Context, event *nostr.Event) error

func (*MongoDBBackend) Init

func (m *MongoDBBackend) Init() error

func (*MongoDBBackend) QueryEvents

func (m *MongoDBBackend) QueryEvents(ctx context.Context, filter nostr.Filter) (chan *nostr.Event, error)

func (*MongoDBBackend) ReplaceEvent

func (b *MongoDBBackend) ReplaceEvent(ctx context.Context, evt *nostr.Event) error

func (*MongoDBBackend) SaveEvent

func (m *MongoDBBackend) SaveEvent(ctx context.Context, event *nostr.Event) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL