Refactor proto file structure to move brain and dtpm modules under sgx for better organization

This commit is contained in:
Noor 2025-02-13 17:28:09 +05:30
parent f2bc29149e
commit ee592c71d6
Signed by: noormohammedb
GPG Key ID: D83EFB8B3B967146
8 changed files with 20 additions and 16 deletions

@ -2,7 +2,10 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
tonic_build::configure()
.build_server(true)
.protoc_arg("--experimental_allow_proto3_optional")
.compile_protos(&["proto/brain.proto", "proto/dtpm.proto"], &["proto"])?;
.compile_protos(
&["proto/sgx/brain.proto", "proto/sgx/dtpm.proto"],
&["proto"],
)?;
Ok(())
}

@ -1,12 +1 @@
pub mod pb {
pub mod brain {
tonic::include_proto!("brain");
}
pub mod dtpm {
tonic::include_proto!("dtpm");
}
}
pub mod types;
pub mod sgx;

12
src/sgx/mod.rs Normal file

@ -0,0 +1,12 @@
pub mod types;
pub mod pb {
pub mod brain {
tonic::include_proto!("brain");
}
pub mod dtpm {
tonic::include_proto!("dtpm");
}
}

@ -1,5 +1,5 @@
use crate::pb::brain::{daemon_message_app, AppNodeResources, DaemonMessageApp, NewAppRes};
use crate::pb::brain::{AppResource, DaemonAuth, MappedPort, NewAppReq};
use crate::sgx::pb::brain::{daemon_message_app, AppNodeResources, DaemonMessageApp, NewAppRes};
use crate::sgx::pb::brain::{AppResource, DaemonAuth, MappedPort, NewAppReq};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]

@ -1,4 +1,4 @@
use crate::pb::dtpm as pb_dtpm;
use crate::sgx::pb::dtpm as pb_dtpm;
use base64::{engine::general_purpose::STANDARD as BASE64, Engine};
use serde::{Deserialize, Serialize};