For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
Skip to content

Overview

highvolt-server is the central analysis engine. It exposes a REST API over HTTP or HTTPS, accepts file submissions from clients, queues them for asynchronous LLM analysis, and stores results in OpenObserve (preferred) and/or OpenSearch.

Source layout

cmd/highvolt-server/
├── main.go          — startup, HTTP routing, TLS, shutdown
├── submit.go        — POST /submit handler
├── query.go         — POST /query handler
├── jwt.go           — authentication token issuance and middleware
├── ratelimit.go     — per-IP rate limiting for /auth/token
├── haproxy.go       — optional HAProxy TCP health agent
├── reload.go        — config/debug reload monitor
├── signal.go        — OS signal handler
├── log.go           — HTTP request logger middleware
├── auth/
│   └── jwt_pat.go   — PAT → JWT exchange for JSONAir
├── config/
│   ├── config.go    — config fetch, parse, and hot-reload
│   └── env.go       — environment variable loading
├── db/
│   ├── store.go       — backend-agnostic Store interface, write/query fan-out
│   ├── opensearch.go  — OpenSearch index and search
│   └── openobserve.go — OpenObserve index and search
├── debug/
│   └── debug.go     — debug flag management
├── helpers/
│   ├── helpers.go   — MIME type classification
│   └── sanity.go    — JSON payload validation
├── llm/
│   └── llm.go       — LLM submission (OpenAI-compatible)
├── models/
│   ├── config.go    — config structs
│   └── env.go       — environment structs
├── processors/
│   ├── submit_data.go — dispatch to per-type processor
│   ├── pdf.go         — PDF → PNG → LLM
│   ├── office.go      — Office → PDF → PNG → LLM
│   └── archive.go     — archive extraction and per-file analysis
└── queue/
    ├── queue.go     — in-memory bounded channel queue
    ├── worker.go    — goroutine worker pool
    └── dowork.go    — per-item work dispatch

Startup sequence

  1. Logger initialized to local syslog.

  2. Environment variables loaded (needed to reach JSONAir).

  3. PAT exchanged for a JSONAir JWT; configuration blob fetched.

  4. Background goroutines started: config monitor, signal handler.

  5. Logger reconfigured to user-specified syslog target.

  6. Debug level fetched from JSONAir.

  7. Storage backends initialized (OpenObserve and/or OpenSearch, per write_backends / query_backend).

  8. Worker pool started.

  9. HAProxy TCP agent started (if enabled).

  10. HTTP server bound (drops Unix privileges after bind).

Last updated