forked from hyperium/tonic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates reflection server implementation
This change updates jen20's work in hyperium#340 to work with the file descriptor set changes that landed in prost 0.7. * Updates branch with new changes from master * Updates server to use tokio 1.0 symantics * `tonic_build::Builder::include_file_descriptor_set` -> `file_descriptor_set_path`, which matchesprost. * The reflection server now returns UNIMPLEMENTED rather than NOT_FOUND when unsupported methods are called.
- Loading branch information
Showing
10 changed files
with
76 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,20 @@ | ||
use std::env; | ||
use std::path::PathBuf; | ||
|
||
fn main() { | ||
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap()); | ||
|
||
tonic_build::configure() | ||
.type_attribute("routeguide.Point", "#[derive(Hash)]") | ||
.compile(&["proto/routeguide/route_guide.proto"], &["proto"]) | ||
.unwrap(); | ||
|
||
tonic_build::compile_protos("proto/helloworld/helloworld.proto").unwrap(); | ||
tonic_build::configure() | ||
.file_descriptor_set_path(out_dir.join("helloworld_descriptor.bin")) | ||
.compile(&["proto/helloworld/helloworld.proto"], &["proto"]) | ||
.unwrap(); | ||
|
||
tonic_build::compile_protos("proto/echo/echo.proto").unwrap(); | ||
|
||
tonic_build::compile_protos("proto/google/pubsub/pubsub.proto").unwrap(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[package] | ||
name = "tonic-health" | ||
version = "0.3.0" | ||
authors = ["James Nugent <[email protected]>"] | ||
authors = ["James Nugent <[email protected]>", "Samani G. Gikandi <[email protected]>"] | ||
edition = "2018" | ||
license = "MIT" | ||
repository = "https://github.com/hyperium/tonic" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "tonic-reflection" | ||
version = "0.1.0" | ||
version = "0.4.0" | ||
authors = ["James Nugent <[email protected]>"] | ||
edition = "2018" | ||
license = "MIT" | ||
|
@@ -14,11 +14,12 @@ categories = ["network-programming", "asynchronous"] | |
keywords = ["rpc", "grpc", "async", "reflection"] | ||
|
||
[dependencies] | ||
bytes = "0.5" | ||
prost = "0.6" | ||
prost-types = "0.6" | ||
tokio = { version = "0.2", features = ["sync", "stream"] } | ||
tonic = { version = "0.2", path = "../tonic", features = ["codegen", "prost"] } | ||
bytes = "1.0" | ||
prost = "0.7" | ||
prost-types = "0.7" | ||
tokio = { version = "1.0", features = ["sync"] } | ||
tonic = { version = "0.4", path = "../tonic", features = ["codegen", "prost"] } | ||
tokio-stream = "0.1" | ||
|
||
[build-dependencies] | ||
tonic-build = { version = "0.2", path = "../tonic-build" } | ||
tonic-build = { version = "0.4", path = "../tonic-build" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters