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 dispatchStartup sequence
Logger initialized to
localsyslog.Environment variables loaded (needed to reach JSONAir).
PAT exchanged for a JSONAir JWT; configuration blob fetched.
Background goroutines started: config monitor, signal handler.
Logger reconfigured to user-specified syslog target.
Debug level fetched from JSONAir.
Storage backends initialized (OpenObserve and/or OpenSearch, per
write_backends/query_backend).Worker pool started.
HAProxy TCP agent started (if enabled).
HTTP server bound (drops Unix privileges after bind).
Last updated