Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRouter ¶
func NewRouter(cfg RouterConfig) http.Handler
NewRouter builds and returns the application HTTP handler.
Types ¶
type AdminGate ¶
AdminGate is the runtime knob for the admin-only endpoints. Held by RouterConfig so routes can choose to skip registration when disabled.
type RouterConfig ¶
type RouterConfig struct {
Logger *slog.Logger
Session *torrent.Session
WSHub *ws.Hub
Categories *category.Service
Tags *tag.Service
DB *sql.DB
// Admin gates the diagnostics + cleanup-history endpoints. When nil
// or DiagnosticsEnabled=false the routes are not registered at all
// (404 on every /api/v1/admin/* path).
Admin *AdminGate
// Pulse is the optional integration used to discover sibling
// services for the Activity page deep-links. Nil when Haul is
// running standalone — the peers endpoint then returns an empty map.
Pulse *pulse.Integration
// LogSystem + DockerLogs come from pulse/pkg/log. When LogSystem
// is non-nil, /api/v1/system/{logs,log-level} are registered.
// When DockerLogs is also non-nil, /api/v1/system/logs/docker
// is registered for full-history access.
LogSystem *beaconlog.System
DockerLogs *beaconlog.DockerLogsReader
}
RouterConfig holds everything the router needs.
Click to show internal directories.
Click to hide internal directories.