Expand description
REST→gRPC transcoding layer.
Reads google.api.http annotations from proto service descriptors
and builds axum routes that proxy JSON/form requests to gRPC upstream.
The upstream decides the HTTP answer beyond the JSON body where it needs
to: its response metadata becomes response headers, x-http-code sets the
status of a successful unary call, and google.api.HttpBody carries a raw
body in either direction.
Generic: works with ANY proto descriptor set. No product-specific code.
Modules§
- body
- Request body media type.
- codec
- Dynamic gRPC codec for
prost-reflect::DynamicMessage. - error
- gRPC → HTTP error mapping.
- metadata
- HTTP → gRPC metadata, trace-context, and deadline propagation.
- request
- Request message construction for REST→gRPC transcoding.
Structs§
- RpcSelection
- The RPCs transcoded to REST: every one with a
google.api.httprule, or only the services and methods named. - Transcode
Options - How
routes_with_optionsbuilds the transcoded routes.
Constants§
- UPSTREAM_
DEADLINE - How long the upstream may take to answer a call with its response headers
when the client’s
grpc-timeoutasks for no shorter deadline.
Traits§
- Transcode
State - Trait for state types that support REST→gRPC transcoding.
Functions§
- proto_
path_ to_ axum - Convert a
google.api.httppath template to axum 0.8 path syntax. - route_
paths - The axum paths
routes_with_optionswould register for this pool, aliases and selection. - routes
- Build transcoded REST→gRPC routes from a descriptor pool.
- routes_
with_ options routes, built asoptionsdescribe.