Skip to main content

Crate ursula

Crate ursula 

Source
Expand description

Ursula HTTP server: axum router, request handlers, response rendering, plus the typed-config bootstrap constructors used by the ursula binary.

Module map:

  • [render]: response builders, header helpers, SSE/multipart rendering.
  • [bootstrap]: typed-config spawn_*_runtime constructors and cold-flush worker.
  • server: command arguments and the long-running server service entrypoint.

Modules§

server

Structs§

ClientWriteLeaderRouter
Resolves the current leader of a raft group to a client-reachable base URL so a write/read that lands on a non-leader can be answered with a 307 redirect. peers maps raft node id to that node’s configured peer URL: server.listen when server.cluster_listen is unset, or the separate server.cluster_listen address when it is set. Peer URLs are also used as HTTP leader-redirect targets, so clients and gateways must be able to reach them too.
HttpState
IngressAdmission
Client-plane ingress admission. The primary control is a process-wide in-flight write-body byte budget: a request must reserve its body bytes before axum drains the body into Bytes, and the reservation lives until the response is produced. This is the layer that turns memory pressure into backpressure at the HTTP edge.
NodeMemoryMonitor
Process-wide RSS monitor. It reports RSS in /__ursula/metrics and exits when the last-resort abort cap is exceeded. It does not reject writes; ingress byte admission is the write-path memory control.
SpawnedRuntime
Result of spawning a runtime.
SystemWallClock

Enums§

Persistence
Persistence strategy for the runtime.
Topology
Deployment topology.

Traits§

WallClock

Functions§

admin_router
Admin-plane routes: the mutating operator surface (raft group operations, maintenance drain, cold-flush trigger) plus read-only metrics so operator tooling works over a single tunnel. Production binds this to server.admin_listen (loopback by default) — nodes expose no cluster-mutation endpoints on the client or cluster planes.
client_router_with_admission
cluster_router_from_state
Cluster-plane routes: inter-node gRPC carrying Raft RPCs, snapshot transfer, and leader-read checks. In a dual-listener deployment these bind to the private (VPC) interface so chaos applied to the public face never disrupts consensus.
router
router_with_http_state
Convenience wrapper that merges the client, cluster, and admin planes into a single router. Used by in-process tests and the madsim harness, where per-plane listeners would only add noise.
router_with_raft_registry
router_with_static_raft_cluster
router_with_static_raft_cluster_topology
spawn_runtime
Spawn a runtime from a typed ursula_config::UrsulaConfig.