lmdb

package
v0.0.0-...-96f8989 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: Unlicense Imports: 19 Imported by: 6

Documentation

Index

Constants

View Source
const (
	DB_VERSION byte = 'v'
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LMDBBackend

type LMDBBackend struct {
	Path    string
	MapSize int64

	EnableHLLCacheFor func(kind nostr.Kind) (useCache bool, skipSavingActualEvent bool)
	// contains filtered or unexported fields
}

func (*LMDBBackend) Close

func (b *LMDBBackend) Close()

func (*LMDBBackend) Compact

func (b *LMDBBackend) Compact(tmppath string) error

Compact can only be called when the database is not being used because it will overwrite everything. It will temporarily move the database to a new location, then move it back. If something goes wrong crash the process and look for the copy of the data on tmppath.

func (*LMDBBackend) CountEvents

func (b *LMDBBackend) CountEvents(filter nostr.Filter) (uint32, error)

func (*LMDBBackend) CountEventsHLL

func (b *LMDBBackend) CountEventsHLL(filter nostr.Filter, offset int) (uint32, *hyperloglog.HyperLogLog, error)

CountEventsHLL is like CountEvents, but it will build a hyperloglog value while iterating through results, following NIP-45

func (*LMDBBackend) DeleteEvent

func (b *LMDBBackend) DeleteEvent(id nostr.ID) error

func (*LMDBBackend) Init

func (b *LMDBBackend) Init() error

func (*LMDBBackend) QueryEvents

func (b *LMDBBackend) QueryEvents(filter nostr.Filter, maxLimit int) iter.Seq[nostr.Event]

func (*LMDBBackend) ReplaceEvent

func (b *LMDBBackend) ReplaceEvent(evt nostr.Event) (deleted []nostr.Event, err error)

func (*LMDBBackend) SaveEvent

func (b *LMDBBackend) SaveEvent(evt nostr.Event) error

Jump to

Keyboard shortcuts

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