Documentation
¶
Index ¶
- func Close() error
- func Get() *sql.DB
- func GetLatestEventTimestamp() (int64, error)
- func GetRecentTorrents(limit int) ([]map[string]interface{}, error)
- func GetSetting(key string) (string, error)
- func GetStats() (map[string]interface{}, error)
- func GetTorrentsPerDay(days int) ([]map[string]interface{}, error)
- func Init(dbPath string) error
- func IsSetupCompleted() bool
- func LogActivity(eventType string, details string) error
- func SeedDefaultRelays(relays []RelayConfig) error
- func SeedDefaultWhitelist() error
- func SetSetting(key, value string) error
- type RelayConfig
- type WhitelistEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLatestEventTimestamp ¶
GetLatestEventTimestamp returns a unix timestamp to resume historical fetch from. Uses MAX(first_seen_at) from torrents (indexed, fast) minus a 1-hour buffer to account for clock skew between local time and relay event timestamps, and to catch any late-arriving events. This means a small overlap is re-processed on restart, which is safe since the deduplicator handles duplicates.
func GetRecentTorrents ¶
GetRecentTorrents returns the most recent torrents
func GetSetting ¶
GetSetting retrieves a setting value by key
func GetTorrentsPerDay ¶
GetTorrentsPerDay returns torrent counts for the last N days
func IsSetupCompleted ¶
func IsSetupCompleted() bool
IsSetupCompleted checks if the setup wizard has been completed
func LogActivity ¶
LogActivity logs an activity event
func SeedDefaultRelays ¶
func SeedDefaultRelays(relays []RelayConfig) error
SeedDefaultRelays inserts default relays if the relays table is empty
func SeedDefaultWhitelist ¶
func SeedDefaultWhitelist() error
SeedDefaultWhitelist adds default trusted users to the whitelist
Types ¶
type RelayConfig ¶
RelayConfig represents a relay configuration for seeding
type WhitelistEntry ¶
WhitelistEntry represents a default whitelist entry