From eb760d219206c77dd3a105ecb6a3ba97d9d650ec Mon Sep 17 00:00:00 2001 From: LFC Date: Mon, 20 Mar 2023 21:23:58 +0800 Subject: [PATCH] feat: add gRPC reflection service (#17) * feat: add grpc reflection * feat: add grpc reflection --- build.rs | 8 ++++++++ src/v1.rs | 2 ++ 2 files changed, 10 insertions(+) diff --git a/build.rs b/build.rs index 281ed8a..e94a49e 100644 --- a/build.rs +++ b/build.rs @@ -12,8 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. +use std::path::PathBuf; + fn main() { + let out_dir = PathBuf::from( + std::env::var("OUT_DIR") + .expect("cargo built-in env value 'OUT_DIR' must be set during compilation"), + ); + tonic_build::configure() + .file_descriptor_set_path(out_dir.join("greptime_grpc_desc.bin")) .compile( &[ "proto/greptime/v1/database.proto", diff --git a/src/v1.rs b/src/v1.rs index d17ce2e..ff7239b 100644 --- a/src/v1.rs +++ b/src/v1.rs @@ -14,4 +14,6 @@ tonic::include_proto!("greptime.v1"); +pub const GREPTIME_GRPC_DESC: &[u8] = tonic::include_file_descriptor_set!("greptime_grpc_desc"); + pub mod meta;