Documentation
¶
Index ¶
- type MySQLBackend
- func (b *MySQLBackend) Close()
- func (b *MySQLBackend) CountEvents(ctx context.Context, filter nostr.Filter) (int64, error)
- func (b *MySQLBackend) CountEventsFilters(ctx context.Context, filters nostr.Filters) (int64, error)
- func (b *MySQLBackend) DeleteEvent(ctx context.Context, evt *nostr.Event) error
- func (b *MySQLBackend) Init() error
- func (b *MySQLBackend) QueryEvents(ctx context.Context, filter nostr.Filter) (ch chan *nostr.Event, err error)
- func (b *MySQLBackend) ReplaceEvent(ctx context.Context, evt *nostr.Event) error
- func (b *MySQLBackend) SaveEvent(ctx context.Context, evt *nostr.Event) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MySQLBackend ¶
type MySQLBackend struct {
sync.Mutex
*sqlx.DB
DatabaseURL string
QueryLimit int
QueryIDsLimit int
QueryAuthorsLimit int
QueryKindsLimit int
QueryTagsLimit int
}
func (*MySQLBackend) Close ¶
func (b *MySQLBackend) Close()
func (*MySQLBackend) CountEvents ¶
func (*MySQLBackend) CountEventsFilters ¶ added in v0.17.13
func (b *MySQLBackend) 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 (*MySQLBackend) DeleteEvent ¶
func (*MySQLBackend) Init ¶
func (b *MySQLBackend) Init() error
func (*MySQLBackend) QueryEvents ¶
func (*MySQLBackend) ReplaceEvent ¶ added in v0.15.0
Click to show internal directories.
Click to hide internal directories.