Skip to content

Commit 2417186

Browse files
committed
use versioned protos
1 parent b68dfeb commit 2417186

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
2727
// Make all messages serde-serializable.
2828
.type_attribute(".", "#[derive(serde::Serialize,serde::Deserialize)]")
2929
// Compiling protos using path on build time.
30-
.compile_protos(&["proto/core/proxy.proto"], &["proto/core"])?;
30+
.compile_protos(&["proto/v2/core/proxy.proto"], &["proto/v2/core"])?;
3131

3232
println!("cargo:rerun-if-changed=proto");
3333
Ok(())

src/lib.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,18 @@ pub mod http;
1515
pub mod logging;
1616
mod setup;
1717

18+
pub(crate) mod generated {
19+
pub(crate) mod defguard {
20+
pub(crate) mod proxy {
21+
pub(crate) mod v2 {
22+
tonic::include_proto!("defguard.proxy.v2");
23+
}
24+
}
25+
}
26+
}
27+
1828
pub(crate) mod proto {
19-
tonic::include_proto!("defguard.proxy");
29+
pub(crate) use crate::generated::defguard::proxy::v2::*;
2030
}
2131

2232
#[macro_use]

0 commit comments

Comments
 (0)