feat: initial schema

This commit is contained in:
hdbg
2026-02-10 14:03:01 +01:00
parent 7816518977
commit 5b27c78bfc
8 changed files with 60 additions and 26 deletions

View File

@@ -9,6 +9,9 @@ prost.workspace = true
bytes = "1.11.1"
prost-derive = "0.14.3"
prost-types = { version = "0.14.3", features = ["chrono"] }
tonic-prost = "0.14.3"
[build-dependencies]
prost-build = "0.14.3"
serde_json = "1"
tonic-prost-build = "0.14.3"

View File

@@ -1,9 +1,16 @@
use tonic_prost_build::configure;
static PROTOBUF_DIR: &str = "../../../protobufs";
fn main() -> Result<(), Box<dyn std::error::Error>> {
configure()
.proto_path("../../../protobufs")
.compile_protos(&["../../../protobufs/auth.proto"], &["../../../protobufs"])
.compile_protos(
&[
format!("{}/arbiter.proto", PROTOBUF_DIR),
format!("{}/auth.proto", PROTOBUF_DIR),
],
&[PROTOBUF_DIR.to_string()],
)
.unwrap();
Ok(())
}

View File

@@ -1,14 +1,7 @@
pub fn add(left: u64, right: u64) -> u64 {
left + right
}
pub mod proto {
tonic::include_proto!("arbiter");
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn it_works() {
let result = add(2, 2);
assert_eq!(result, 4);
pub mod auth {
tonic::include_proto!("arbiter.auth");
}
}