Refactor proto file structure to move brain and dtpm modules under sgx for better organization
This commit is contained in:
parent
f2bc29149e
commit
ee592c71d6
5
build.rs
5
build.rs
@ -2,7 +2,10 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
tonic_build::configure()
|
tonic_build::configure()
|
||||||
.build_server(true)
|
.build_server(true)
|
||||||
.protoc_arg("--experimental_allow_proto3_optional")
|
.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(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
13
src/lib.rs
13
src/lib.rs
@ -1,12 +1 @@
|
|||||||
pub mod pb {
|
pub mod sgx;
|
||||||
|
|
||||||
pub mod brain {
|
|
||||||
tonic::include_proto!("brain");
|
|
||||||
}
|
|
||||||
|
|
||||||
pub mod dtpm {
|
|
||||||
tonic::include_proto!("dtpm");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub mod types;
|
|
12
src/sgx/mod.rs
Normal file
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::sgx::pb::brain::{daemon_message_app, AppNodeResources, DaemonMessageApp, NewAppRes};
|
||||||
use crate::pb::brain::{AppResource, DaemonAuth, MappedPort, NewAppReq};
|
use crate::sgx::pb::brain::{AppResource, DaemonAuth, MappedPort, NewAppReq};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
|
#[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 base64::{engine::general_purpose::STANDARD as BASE64, Engine};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user