api

package
v0.0.0-...-945563d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2026 License: MIT Imports: 18 Imported by: 0

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

type AdminGate struct {
	DiagnosticsEnabled bool
	Registry           *adminpkg.Registry
}

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL