Documentation
¶
Index ¶
- Variables
- type TursoBackend
- func (b *TursoBackend) Close()
- func (b *TursoBackend) CountEvents(ctx context.Context, filter nostr.Filter) (int64, error)
- func (b *TursoBackend) CountEventsFilters(ctx context.Context, filters nostr.Filters) (int64, error)
- func (b *TursoBackend) DeleteEvent(ctx context.Context, evt *nostr.Event) error
- func (b *TursoBackend) Init() error
- func (b *TursoBackend) QueryEvents(ctx context.Context, filter nostr.Filter) (ch chan *nostr.Event, err error)
- func (b *TursoBackend) ReplaceEvent(ctx context.Context, evt *nostr.Event) error
- func (b *TursoBackend) SaveEvent(ctx context.Context, evt *nostr.Event) error
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type TursoBackend ¶
type TursoBackend struct {
sync.Mutex
*sqlx.DB
DatabaseURL string
QueryLimit int
QueryIDsLimit int
QueryAuthorsLimit int
QueryKindsLimit int
QueryTagsLimit int
}
func (*TursoBackend) Close ¶
func (b *TursoBackend) Close()
func (*TursoBackend) CountEvents ¶
func (*TursoBackend) CountEventsFilters ¶ added in v0.17.13
func (b *TursoBackend) CountEventsFilters(ctx context.Context, filters nostr.Filters) (int64, error)
CountEventsFilters counts the events matching any of the filters, counting an event that matches more than one of them only once. NIP-45 OR's the filters together into a single count, so summing a per-filter count would report overlapping filters more than once. The union is evaluated by the database: pulling the ids back to deduplicate them here would cost one id per stored event.
func (*TursoBackend) DeleteEvent ¶
func (*TursoBackend) Init ¶
func (b *TursoBackend) Init() error
func (*TursoBackend) QueryEvents ¶
func (*TursoBackend) ReplaceEvent ¶
Click to show internal directories.
Click to hide internal directories.