1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//! gRPC for [Autumn](https://autumn-web.app), built on
//! [tonic](https://docs.rs/tonic).
//!
//! ```rust,ignore
//! use autumn_plugin_grpc::GrpcPlugin;
//!
//! #[autumn_web::main]
//! async fn main() {
//! autumn_web::app()
//! .routes(routes![index])
//! .plugin(GrpcPlugin::new().add_service(GreeterServer::new(MyGreeter)))
//! .run()
//! .await;
//! }
//! ```
//!
//! The plugin runs a dedicated HTTP/2 listener (default `0.0.0.0:50051`).
//! With the `multiplex` feature and `listener = "shared"`, it uses
//! Autumn's HTTP port instead. It adds:
//!
//! - the standard health service `grpc.health.v1.Health`,
//! - server reflection (on in `dev`/`test`),
//! - a `grpc` indicator in `/actuator/health`,
//! - `grpc_server_*` metrics in `/actuator/prometheus`,
//! - `AppState` in each request's extensions,
//! - graceful drain on shutdown.
//!
//! With the `client` feature, handlers call other gRPC services with
//! `GrpcClient` and `GrpcClients` (`[grpc.clients.<name>]`).
//!
//! See [`GrpcConfig`] for the `[grpc]` section of `autumn.toml`.
pub use ;
pub use ;
pub use GrpcError;
pub use ;
pub use ;
pub use GrpcServers;
pub use GrpcHandle;
/// Re-exports, so apps use the same tonic version as the plugin.
pub use tonic;
pub use tonic_health;
pub use tonic_reflection;