Documentation
¶
Overview ¶
Package webserver is the optional rfscope web console backend: a self-contained HTTP server that stages an uploaded IQ capture, runs the rfscope segmentation + analyzers over it, and returns the structured Scene (plus a cryptolab `ks` frames file for any unknown payloads). It is the browser counterpart to the `rfscope` CLI/TUI, modeled on the cryptolab and siglab web consoles.
It depends only on the rfscope package and the standard library, and is imported only by the `rfscope serve` command.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
// Assets is the embedded SPA file system (served at /). Nil serves the API
// only with a short placeholder at /.
Assets fs.FS
// TempDir stages uploads. Empty ⇒ a fresh temp dir the server owns and
// removes on Close.
TempDir string
// MaxUploadBytes bounds one upload. 0 ⇒ 512 MiB.
MaxUploadBytes int64
// AnalyzeTimeout bounds one analysis. 0 ⇒ 120s.
AnalyzeTimeout time.Duration
// Logger receives server-level logs. Nil ⇒ slog.Default.
Logger *slog.Logger
}
Options configure a Server.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the rfscope web console HTTP handler.
func New ¶
New constructs a Server. The staging temp directory is created lazily on the first upload, so merely registering the routes costs nothing on disk.
func (*Server) Handler ¶
Handler returns a standalone HTTP mux: the rfscope API plus the embedded SPA at /. Used by `rfscope serve`.
func (*Server) RegisterAPI ¶
func (s *Server) RegisterAPI(mux *http.ServeMux, gate func(http.HandlerFunc) http.HandlerFunc)
RegisterAPI mounts the /api/v1/rfscope/* routes onto mux. Mutating routes are wrapped with gate when non-nil so a daemon can apply the same auth middleware; the standalone server passes nil.