Documentation
¶
Index ¶
- Constants
- type LMDBBackend
- func (b *LMDBBackend) Close()
- func (b *LMDBBackend) Compact(tmppath string) error
- func (b *LMDBBackend) CountEvents(filter nostr.Filter) (uint32, error)
- func (b *LMDBBackend) CountEventsHLL(filter nostr.Filter, offset int) (uint32, *hyperloglog.HyperLogLog, error)
- func (b *LMDBBackend) DeleteEvent(id nostr.ID) error
- func (b *LMDBBackend) Init() error
- func (b *LMDBBackend) QueryEvents(filter nostr.Filter, maxLimit int) iter.Seq[nostr.Event]
- func (b *LMDBBackend) ReplaceEvent(evt nostr.Event) (deleted []nostr.Event, err error)
- func (b *LMDBBackend) SaveEvent(evt nostr.Event) error
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 (*LMDBBackend) ReplaceEvent ¶
Click to show internal directories.
Click to hide internal directories.