Documentation
¶
Overview ¶
Package compile orchestrates ephemeral microVM compile jobs. The V0.1 backend SIMULATES a compile (returns a canned PDF when language=latex, an empty binary otherwise) so the rest of the stack is testable end-to-end without a running weft-agent. V0.2 wires the gRPC client to weft-agent that spawns a real microVM from a per-language OCI image (weft-loom-texlive, weft-loom-golang, …) with the project files mounted RO + a writable scratch overlay for build artefacts.
JobSpec → Service.Start → background goroutine → Event channel → SSE stream to the frontend → final "result" event with the artifact path or compile error.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct {
Kind string `json:"kind"` // "log" | "result" | "error"
Line string `json:"line,omitempty"`
// For Kind=="result" :
Success bool `json:"success,omitempty"`
Artifact string `json:"artifact,omitempty"` // URL the SPA fetches to download
ArtifactMIME string `json:"artifact_mime,omitempty"`
DurationMs int64 `json:"duration_ms,omitempty"`
}
Event is one streamed line during a compile job.
type JobSpec ¶
type JobSpec struct {
// Project is the project name (filled by the handler from the
// path param ; clients don't need to populate).
Project string `json:"-"`
// Language picks the OCI image weft-agent pulls
// (latex/go/cpp/python/...). When empty the service detects from
// the project's language hint.
Language string `json:"language"`
// Entry is the main file (e.g. "main.tex", "main.go"). Optional ;
// per-language defaults apply.
Entry string `json:"entry,omitempty"`
// ExtraArgs are appended to the language's default build command.
ExtraArgs []string `json:"extra_args,omitempty"`
}
JobSpec is the request shape POSTed to /api/projects/<n>/compile.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service starts jobs + serves their event streams.