Expand description
§solti-api - task management API.
Dual-transport API layer exposing task operations over gRPC and HTTP.
Both transports share the same wire types generated from proto/solti/task/v1/*.proto and delegate to an ApiHandler implementation.
| feature | transport | module |
|---|---|---|
grpc | tonic gRPC server | TaskApiService, TaskServiceServer |
http | axum HTTP/JSON | HttpApi |
§Quick start
Build one ApiHandler and share it across both transports (the handler is Arc-wrapped once, then cloned into each server):
let handler = Arc::new(SupervisorApiAdapter::new(supervisor));
let grpc = TaskServiceServer::new(TaskApiService::new(handler.clone()));
let http = HttpApi::new(handler).router();§Also
ApiHandlertransport-agnostic trait with 6 operations.ApiErrorunified error type mapped to gRPC Status / HTTP JSON.SupervisorApiAdapterdefault adapter bridging toSupervisorApi.
Re-exports§
Structs§
- Bearer
Auth - gRPC interceptor enforcing a bearer token on every call.
- HttpApi
- HTTP API service builder.
- NoOp
ApiMetrics - Zero-cost default implementation.
- Supervisor
ApiAdapter - Adapter that bridges
SupervisorApitoApiHandler. - Task
ApiService - gRPC service wrapping an
ApiHandler. - Task
Service Server - Task management API exposed by the agent. The control-plane is the client; the agent runs the tasks.
Enums§
Constants§
- API_
VERSION - Current API protocol version.
- MAX_
REQUEST_ BYTES - Maximum accepted request body / message size for both HTTP and gRPC transports. 4 MiB.
Traits§
- ApiHandler
- Task execution API handler.
- ApiMetrics
Backend - Metrics backend for the API layer.
Functions§
- build_
grpc_ server - Build a configured
TaskServiceServerwith no-op metrics. - build_
grpc_ server_ with_ auth - Like
build_grpc_serverbut enforcing a bearer token on every call. - build_
grpc_ server_ with_ metrics - Build a configured
TaskServiceServerwith an explicit metrics backend. - build_
grpc_ server_ with_ metrics_ auth - Like
build_grpc_server_with_metricsbut enforcing a bearer token. - http_
metrics_ middleware - Axum middleware that records per-request HTTP metrics.
- noop_
api_ metrics - Construct a no-op handle: convenient default.
- to_
tonic_ server_ tls - Convert
solti_tls::ServerTlsConfigintotonic::transport::ServerTlsConfig.
Type Aliases§
- ApiMetrics
Handle - Shareable handle used throughout this crate.
- Output
Event Stream - Boxed stream of
OutputEvents — the wire-side surface of live task logs.