-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Tom Dyas
authored
Oct 22, 2021
1 parent
4947b07
commit ff6a690
Showing
5 changed files
with
53 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,13 @@ | ||
fn main() { | ||
let mut config = prost_build::Config::new(); | ||
config.extern_path(".google.protobuf.Empty", "()"); | ||
|
||
tonic_build::configure() | ||
.compile_well_known_types(true) | ||
.compile(&["proto/google.proto"], &["proto"]) | ||
.compile_with_config( | ||
config, | ||
&["proto/google.proto", "proto/test.proto"], | ||
&["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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
syntax = "proto3"; | ||
package test; | ||
|
||
import "google/protobuf/empty.proto"; | ||
|
||
message Input { | ||
} | ||
|
||
service Service { | ||
rpc Call(Input) returns (google.protobuf.Empty); | ||
} |
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,9 +1,18 @@ | ||
pub mod google { | ||
pub mod protobuf { | ||
tonic::include_proto!("google.protobuf"); | ||
pub mod gen { | ||
pub mod google { | ||
pub mod protobuf { | ||
tonic::include_proto!("google.protobuf"); | ||
} | ||
} | ||
|
||
pub mod test { | ||
tonic::include_proto!("test"); | ||
} | ||
} | ||
|
||
pub fn grok() { | ||
let _empty = crate::google::protobuf::Empty {}; | ||
let _any = crate::gen::google::protobuf::Any { | ||
type_url: "foo".to_owned(), | ||
value: Vec::new(), | ||
}; | ||
} |
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