Documentation
¶
Index ¶
- func RegisterCatalogHealthRoutes(api huma.API, prober *indexerprobe.Prober)
- func RegisterCatalogRoutes(api huma.API)
- func RegisterDashboardRoutes(api huma.API, agg *dashboard.Aggregator)
- func RegisterDownloadClientRoutes(api huma.API, svc *downloadclient.Service, keyFor ServiceKeyFunc)
- func RegisterEnvRoutes(api huma.API)
- func RegisterIndexerRoutes(api huma.API, mgr *indexer.Manager, proxyBaseURL ...string)
- func RegisterPresetRoutes(api huma.API, q db.Querier)
- func RegisterQualityProfileRoutes(api huma.API, svc *qualityprofile.Service)
- func RegisterRuntimeRoutes(api huma.API, startTime time.Time)
- func RegisterServiceRoutes(api huma.API, svc *registry.Service)
- func RegisterSharedSettingsRoutes(api huma.API, svc *sharedsettings.Service)
- func RegisterSystemRoutes(api huma.API, startTime time.Time, dbPath string)
- func RegisterTagRoutes(api huma.API, svc *tag.Service)
- func RegisterTorznabRoutes(r chi.Router, h *TorznabHandler)
- func RegisterUISettingsRoutes(api huma.API, store *cfgstore.Store)
- func RegisterUpdateRoutes(api huma.API)
- func RegisterVPNRoutes(api huma.API, rotator *gluetun.Rotator, troubles func() []scraper.SiteTrouble)
- type AddIndexerDefaults
- type ServiceKeyFunc
- type TestSearchResult
- type TorznabHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterCatalogHealthRoutes ¶ added in v0.5.0
func RegisterCatalogHealthRoutes(api huma.API, prober *indexerprobe.Prober)
RegisterCatalogHealthRoutes exposes the catalog tester's results.
func RegisterCatalogRoutes ¶
RegisterCatalogRoutes registers the indexer catalog browsing endpoints.
func RegisterDashboardRoutes ¶ added in v0.4.0
func RegisterDashboardRoutes(api huma.API, agg *dashboard.Aggregator)
RegisterDashboardRoutes registers the unified dashboard endpoints. The frontend polls /overview every 2s for the top-level cards and only hits /services/{id} when the drill-down drawer is open.
func RegisterDownloadClientRoutes ¶
func RegisterDownloadClientRoutes(api huma.API, svc *downloadclient.Service, keyFor ServiceKeyFunc)
RegisterDownloadClientRoutes registers download client management endpoints. keyFor may be nil.
func RegisterEnvRoutes ¶ added in v0.4.0
RegisterEnvRoutes exposes the relevant env vars for this process so the Pulse dashboard can show what the operator configured. Secrets are redacted by substring match on the key.
func RegisterIndexerRoutes ¶
func RegisterPresetRoutes ¶
RegisterPresetRoutes registers filter preset CRUD endpoints.
func RegisterQualityProfileRoutes ¶
func RegisterQualityProfileRoutes(api huma.API, svc *qualityprofile.Service)
RegisterQualityProfileRoutes registers quality profile management endpoints.
func RegisterRuntimeRoutes ¶ added in v0.4.0
RegisterRuntimeRoutes registers the Go-runtime stats endpoint.
func RegisterServiceRoutes ¶
RegisterServiceRoutes registers service registry and discovery endpoints.
func RegisterSharedSettingsRoutes ¶
func RegisterSharedSettingsRoutes(api huma.API, svc *sharedsettings.Service)
RegisterSharedSettingsRoutes registers the shared media handling endpoints.
func RegisterSystemRoutes ¶
RegisterSystemRoutes registers system/status endpoints.
func RegisterTagRoutes ¶
RegisterTagRoutes registers the tag management endpoints.
func RegisterTorznabRoutes ¶
func RegisterTorznabRoutes(r chi.Router, h *TorznabHandler)
RegisterTorznabRoutes registers the Torznab proxy endpoint on the chi router. This is registered directly on chi (not Huma) because Torznab uses XML, not JSON.
func RegisterUISettingsRoutes ¶ added in v0.5.0
RegisterUISettingsRoutes exposes Pulse's own UI preferences.
func RegisterUpdateRoutes ¶ added in v0.4.0
RegisterUpdateRoutes registers GET /api/v1/system/updates.
func RegisterVPNRoutes ¶ added in v0.4.0
func RegisterVPNRoutes(api huma.API, rotator *gluetun.Rotator, troubles func() []scraper.SiteTrouble)
RegisterVPNRoutes registers the VPN control endpoints. Only called when a gluetun rotator is configured (see router.go's nil guard). troubles may be nil (no FlareSolverr); advice then never recommends rotating.
Types ¶
type AddIndexerDefaults ¶ added in v0.5.0
type AddIndexerDefaults struct {
Protocols []string `json:"protocols" required:"false" doc:"torrent, usenet"`
Privacies []string `json:"privacies" required:"false" doc:"public, semi-private, private"`
Categories []string `json:"categories" required:"false" doc:"Movies, TV, Audio, Books, XXX, Other"`
Languages []string `json:"languages" required:"false" doc:"Catalog language codes, e.g. en-US"`
}
AddIndexerDefaults are the add-indexer page's starting filters. Empty lists mean "any".
type ServiceKeyFunc ¶ added in v0.5.0
ServiceKeyFunc returns the API key a registered service listens with at host:port, or "" when no registered service is there. It lets Pulse hand the apps the key for a download client that registered itself (Haul), so they can still reach it when it requires a login from everyone.
type TestSearchResult ¶
type TestSearchResult struct {
Success bool `json:"success"`
Message string `json:"message"`
Duration string `json:"duration"`
Results int `json:"results"`
Cloudflare bool `json:"cloudflare,omitempty"`
}
TestSearchResult is the JSON response from the test-search endpoint.
type TorznabHandler ¶
type TorznabHandler struct {
// contains filtered or unexported fields
}
TorznabHandler handles Torznab proxy requests.
func NewTorznabHandler ¶
func NewTorznabHandler(engine *scraper.Engine, q db.Querier, mgr *indexer.Manager, externalURL string, logger *slog.Logger) *TorznabHandler
NewTorznabHandler creates a new handler. externalURL is optional; when set, torznab download proxy URLs use it instead of the request's Host header. mgr may be nil (tests) — search-health recording is then skipped.
func (*TorznabHandler) Handle ¶
func (h *TorznabHandler) Handle(w http.ResponseWriter, r *http.Request)
Handle dispatches Torznab requests based on the ?t= parameter.
func (*TorznabHandler) HandleDownload ¶
func (h *TorznabHandler) HandleDownload(w http.ResponseWriter, r *http.Request)
HandleDownload resolves a download URL from a detail page and redirects to it. This proxies downloads through Pulse so the client doesn't need CF cookies or tracker sessions. The detail page URL is passed via ?url= query param.
GET /api/v1/torznab/{indexer_id}/download?url=https://1337x.to/torrent/12345/...
func (*TorznabHandler) HandleTestSearch ¶
func (h *TorznabHandler) HandleTestSearch(w http.ResponseWriter, r *http.Request)
HandleTestSearch does a real search through the scraper engine to validate that an indexer is functional — not just that its URL responds with HTTP 200.