- add: character db client to allow the character service to talk to the database service - update: character.proto to make character data shared
17 lines
751 B
Rust
17 lines
751 B
Rust
fn main() {
|
|
// gRPC Server code
|
|
tonic_build::configure()
|
|
.build_server(true) // Generate gRPC server code
|
|
.compile_well_known_types(true)
|
|
.type_attribute(".", "#[derive(serde::Serialize, serde::Deserialize)]")
|
|
.compile_protos(&["../proto/character_common.proto", "../proto/character.proto"], &["../proto"])
|
|
.unwrap_or_else(|e| panic!("Failed to compile protos {:?}", e));
|
|
|
|
// gRPC Client code
|
|
tonic_build::configure()
|
|
.build_server(false) // Generate gRPC client code
|
|
.compile_well_known_types(true)
|
|
.compile_protos(&["../proto/character_db_api.proto", "../proto/auth.proto"], &["../proto"])
|
|
.unwrap_or_else(|e| panic!("Failed to compile protos {:?}", e));
|
|
}
|