Documentation
¶
Index ¶
- Constants
- type LMDBBackend
- func (b *LMDBBackend) Close()
- func (b *LMDBBackend) Compact(tmppath string) error
- func (b *LMDBBackend) CountEvents(ctx context.Context, filter nostr.Filter) (int64, error)
- func (b *LMDBBackend) CountEventsHLL(ctx context.Context, filter nostr.Filter, offset int) (int64, *hyperloglog.HyperLogLog, error)
- func (b *LMDBBackend) DeleteEvent(ctx context.Context, evt *nostr.Event) error
- func (b *LMDBBackend) Init() error
- func (b *LMDBBackend) QueryEvents(ctx context.Context, filter nostr.Filter) (chan *nostr.Event, error)
- func (b *LMDBBackend) ReplaceEvent(ctx context.Context, evt *nostr.Event) error
- func (b *LMDBBackend) SaveEvent(ctx context.Context, evt *nostr.Event) error
- func (b *LMDBBackend) Serial() []byte
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 MaxLimit int MaxLimitNegentropy int MapSize int64 EnableHLLCacheFor func(kind int) (useCache bool, skipSavingActualEvent bool) // contains filtered or unexported fields }
func (*LMDBBackend) Close ¶
func (b *LMDBBackend) Close()
func (*LMDBBackend) Compact ¶ added in v0.14.2
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(ctx context.Context, filter nostr.Filter) (int64, error)
func (*LMDBBackend) CountEventsHLL ¶ added in v0.14.1
func (b *LMDBBackend) CountEventsHLL(ctx context.Context, filter nostr.Filter, offset int) (int64, *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(ctx context.Context, evt *nostr.Event) error
func (*LMDBBackend) Init ¶
func (b *LMDBBackend) Init() error
func (*LMDBBackend) QueryEvents ¶
func (b *LMDBBackend) QueryEvents(ctx context.Context, filter nostr.Filter) (chan *nostr.Event, error)
func (*LMDBBackend) ReplaceEvent ¶ added in v0.14.2
func (b *LMDBBackend) ReplaceEvent(ctx context.Context, evt *nostr.Event) error
func (*LMDBBackend) SaveEvent ¶
func (b *LMDBBackend) SaveEvent(ctx context.Context, evt *nostr.Event) error
func (*LMDBBackend) Serial ¶
func (b *LMDBBackend) Serial() []byte
Click to show internal directories.
Click to hide internal directories.