Skip to main content

Crate solti_api

Crate solti_api 

Source
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.

featuretransportmodule
grpctonic gRPC serverTaskApiService, TaskServiceServer
httpaxum HTTP/JSONHttpApi

§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

Re-exports§

pub use tonic;
pub use axum;

Structs§

BearerAuth
gRPC interceptor enforcing a bearer token on every call.
HttpApi
HTTP API service builder.
NoOpApiMetrics
Zero-cost default implementation.
SupervisorApiAdapter
Adapter that bridges SupervisorApi to ApiHandler.
TaskApiService
gRPC service wrapping an ApiHandler.
TaskServiceServer
Task management API exposed by the agent. The control-plane is the client; the agent runs the tasks.

Enums§

ApiError
Transport
Transport that served a request - the transport metric label.

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.
ApiMetricsBackend
Metrics backend for the API layer.

Functions§

build_grpc_server
Build a configured TaskServiceServer with no-op metrics.
build_grpc_server_with_auth
Like build_grpc_server but enforcing a bearer token on every call.
build_grpc_server_with_metrics
Build a configured TaskServiceServer with an explicit metrics backend.
build_grpc_server_with_metrics_auth
Like build_grpc_server_with_metrics but 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::ServerTlsConfig into tonic::transport::ServerTlsConfig.

Type Aliases§

ApiMetricsHandle
Shareable handle used throughout this crate.
OutputEventStream
Boxed stream of OutputEvents — the wire-side surface of live task logs.