Skip to main content

gonzalo_proto/
lib.rs

1//! Shared gRPC schema for the gonzalo daemon. The generated module mirrors
2//! the `gonzalo.v1` package; payloads are JSON-encoded `gonzalo-core` types.
3
4pub mod http;
5
6pub mod v1 {
7    tonic::include_proto!("gonzalo.v1");
8}
9
10pub use v1::{
11    DeleteRequest, DeleteResponse, GetRequest, GetResponse, GraphLocatedResponse,
12    GraphNamesResponse, GraphQueryRequest, ListRequest, ListResponse, PutRequest, PutResponse,
13    gonzalo_client::GonzaloClient,
14    gonzalo_server::{Gonzalo, GonzaloServer},
15};
16
17/// Default ceiling for a single blob transferred over the daemon, in bytes
18/// (64 MiB). Shared by the server (HTTP body limit + gRPC decode limit) and the
19/// client (gRPC decode limit) so both agree on the supported blob size. The
20/// daemon may raise its own limit via `GONZALO_MAX_BLOB_SIZE`, but a client
21/// still caps decoding at this constant (see gonzalo#184 design ยง4).
22pub const DEFAULT_MAX_BLOB_SIZE: usize = 64 * 1024 * 1024;
23
24#[cfg(test)]
25mod tests {
26    #[test]
27    fn default_max_blob_size_is_64_mib() {
28        assert_eq!(super::DEFAULT_MAX_BLOB_SIZE, 67_108_864);
29    }
30}