Documentation
¶
Index ¶
- func CheckDuplicateEvent(ctx context.Context, evt nostr.Event) (bool, error)
- func DiagnoseQueryIssues(filters []relay.Filter, client *mongo.Client, databaseName string)
- func DisconnectDB(client *mongo.Client)
- func EnsureIndexes(client *mongo.Client, databaseName string) error
- func GetAllAuthorsFromRelay(cfg *configTypes.ServerConfig) []string
- func GetClient() *mongo.Client
- func GetCollection(kind int) *mongo.Collection
- func GetDatabaseName() string
- func InitDB(cfg *config.ServerConfig) (*mongo.Client, error)
- func PurgeOldEvents(cfg *cfgTypes.EventPurgeConfig)
- func QueryEvents(filters []relay.Filter, client *mongo.Client, databaseName string) ([]relay.Event, error)
- func ScheduleEventPurging(cfg *cfgTypes.ServerConfig)
- func StoreMongoEvent(ctx context.Context, evt relay.Event, client relay.ClientInterface)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckDuplicateEvent ¶
CheckDuplicateEvent checks if an event with the same ID already exists in the collection.
func DiagnoseQueryIssues ¶
DiagnoseQueryIssues performs comprehensive database query diagnostics
func GetAllAuthorsFromRelay ¶
func GetAllAuthorsFromRelay(cfg *configTypes.ServerConfig) []string
GetAllAuthorsFromRelay fetches all unique authors from MongoDB.
func GetCollection ¶
func GetCollection(kind int) *mongo.Collection
func GetDatabaseName ¶
func GetDatabaseName() string
GetDatabaseName returns the database name from config
func PurgeOldEvents ¶
func PurgeOldEvents(cfg *cfgTypes.EventPurgeConfig)
PurgeOldEvents removes old events based on the configuration and a list of whitelisted pubkeys.
func QueryEvents ¶
func QueryEvents(filters []relay.Filter, client *mongo.Client, databaseName string) ([]relay.Event, error)
QueryEvents queries events from the MongoDB collection(s) based on filters
func ScheduleEventPurging ¶
func ScheduleEventPurging(cfg *cfgTypes.ServerConfig)
ScheduleEventPurging runs the event purging at a configurable interval.
func StoreMongoEvent ¶
StoreMongoEvent processes and stores an event based on its kind
Types ¶
This section is empty.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.