Documentation
¶
Index ¶
- func RegisterCatalogRoutes(api huma.API)
- func RegisterDashboardRoutes(api huma.API, agg *dashboard.Aggregator)
- func RegisterDownloadClientRoutes(api huma.API, svc *downloadclient.Service)
- 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)
- func RegisterTagRoutes(api huma.API, svc *tag.Service)
- func RegisterTorznabRoutes(r chi.Router, h *TorznabHandler)
- func RegisterUpdateRoutes(api huma.API)
- func RegisterVPNRoutes(api huma.API, rotator *gluetun.Rotator, troubles func() []scraper.SiteTrouble)
- type TestSearchResult
- type TorznabHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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)
RegisterDownloadClientRoutes registers download client management endpoints.
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 ¶
RegisterIndexerRoutes registers indexer management endpoints. proxyBaseURL is the Pulse external URL used for Torznab proxy URL rewriting (e.g., "http://pulse:9696"). If empty, URLs are not rewritten.
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 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 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.