Expand description
Synapse SDK for building services
Provides high-level abstractions for:
- Making RPC calls to other services through the gateway
- Implementing service handlers
- Service registration and lifecycle
§Axum Integration
To embed Synapse RPC into an existing axum application:
ⓘ
use axum::{Router, routing::post};
use synapse_sdk::{axum::synapse_rpc_handler, axum::SynapseState, Service};
let service = Service::builder("my-service").build();
let state = SynapseState::new(service.rpc_server().clone());
let app = Router::new()
.route("/my-endpoints", get(my_handler))
.route("/rpc", post(synapse_rpc_handler))
.with_state(state);Re-exports§
pub use axum::SynapseState;pub use axum::synapse_rpc_handler;pub use client::SynClient;pub use http_server::HealthProvider;pub use http_server::HttpRpcServer;pub use middleware::Middleware;pub use middleware::MiddlewareChain;pub use middleware::RequestState;pub use service::HealthCheckFn;pub use service::HealthStatus;pub use service::HttpRouteConfig;pub use service::HttpRouteGroup;pub use service::Service;pub use service::ServiceBuilder;
Modules§
- axum
- Axum integration for Synapse RPC
- client
- Unified RPC client with connection pooling
- http_
server - HTTP/HTTPS server for service RPC endpoints
- middleware
- Middleware system for service handlers
- service
- Service development helpers
Structs§
- Http
Route - Http
RpcClient - HTTP RPC client
- Instance
Id - Instance identifier - represents a specific running instance of a service
- Interface
Id - Interface identifier - represents a protobuf-defined RPC interface
- Interface
Registration - Registration info for an interface
- Method
Id - Method identifier - represents a method within an RPC interface
- Route
Options - RpcError
- RpcRequest
- RpcResponse
Enums§
- Content
Type - Content type indicator for serialization format
- Http
Method - RpcStatus