Documentation
¶
Overview ¶
Package httpserver is gitrakz's only servicepack service: it boots the whole app — SQLite storage + migrations, the gh sync engine, the transform/template engine, the LLM adapters, and an aichteeteapee/serbewr HTTP server mounting the generated API under /api/v1/ plus the embedded Svelte SPA — and runs a background sync ticker for the lifetime of the process.
Index ¶
Constants ¶
const ServiceName = "http-server"
ServiceName is this service's registry key, matching the folder name convention (http-server -> package httpserver) per wiring-servicepack.md.
Variables ¶
This section is empty.
Functions ¶
func BuildDeps ¶ added in v0.7.0
BuildDeps wires every dependency downstream of store: the gh sync engine, the transform registry (the 7 deterministic primitives plus the LLM-backed describe-work and llm-step primitives), the template engine, and the LLM adapters — returning the shared httpapi.Deps both the generated HTTP API (wire, below) and the MCP server (wire, below, and the `gitrakz mcp` stdio command in cmd/) are built from. Exported so cmd/ can wire the exact same production stack without duplicating this logic.
func SeedBuiltinTemplates ¶ added in v0.7.0
SeedBuiltinTemplates upserts every templates.Builtins() entry into store. SaveTemplate is an idempotent upsert (clause.OnConflict on id, UpdateAll), so calling this on every boot is safe and keeps a running service's built-ins in sync with whatever version of the templates package it ships. A seed failure aborts boot, per New's fail-fast contract. Exported so the `gitrakz mcp` stdio command (see cmd/) seeds the same built-ins the HTTP service would.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service implements servicemanager.Service. New wires every dependency eagerly and fails fast; Run starts the HTTP server and the background sync ticker and blocks until ctx is done; Stop tears both down.
func New ¶
New builds every dependency the service needs (config, storage, migrations, the gh sync engine, the transform/template engine, the LLM adapters, and the HTTP server) and fails fast on the first error — no partially-wired Service is ever returned.