Skip to main content

Crate forge_jobs_api

Crate forge_jobs_api 

Source
Expand description

HTTP API surface for the queue. Mirrors the tauri-plugin-queue command surface — the Tauri plugin will be refactored to thin wrappers around the same handlers in a follow-up. See Cargo.toml for the design rationale.

Public surface:

  • dto — request/response shapes shared across the Tauri and HTTP transports. Kept as a pub mod because callers tend to import many DTOs at once and the namespace is the discoverable contract.
  • handlers — pure async fns over &Storage. Test these directly against an in-memory SQLite, no router or container needed.
  • build_router — Axum router that exposes the handlers as JSON endpoints. Mount via Router::merge(forge_jobs_api::build_router(storage)).
  • metrics_render — Prometheus text rendering helper.
  • Error — handler errors that map to HTTP status codes via axum::response::IntoResponse.

Modules§

dto
Request/response shapes shared by the Tauri plugin and the HTTP transport.
handlers
Pure async fns over &Storage.

Enums§

Error

Functions§

build_router
Build the queue API router. Pass the shared Storage bundle in; it’s cloned into request handlers via Axum’s State extractor.
metrics_render
Collect per-queue samples and render the Prometheus text body.