-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
checked build and added static route to server_client
- Loading branch information
Tammy Tan
authored and
Tammy Tan
committed
Jan 18, 2020
1 parent
25c1770
commit fe77e07
Showing
3 changed files
with
87 additions
and
80 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,64 @@ | ||
syntax = "proto3"; | ||
|
||
package greet; | ||
package calculator; | ||
|
||
|
||
service GreetService { | ||
|
||
//unary API | ||
rpc Greet (GreetRequest) returns (GreetResponse) {}; | ||
|
||
//Server streaming API | ||
rpc GreetManyTimes (GreetManyTimesRequest) returns ( stream GreetManyTimesResponse) {}; | ||
|
||
// Client Streaming | ||
rpc LongGreet (stream LongGreetRequest) returns (LongGreetResponse) {}; | ||
service CalculatorService { | ||
//Unary API | ||
rpc Sum (SumRequest) returns (SumResponse) {}; | ||
|
||
// BiDi Streaming | ||
rpc GreetEveryone (stream GreetEveryoneRequest) returns ( stream GreetEveryoneResponse) {}; | ||
// Streaming API | ||
rpc PrimeNumberDecomposition (PrimeNumberDecompositionRequest) returns ( stream PrimeNumberDecompositionResponse) {}; | ||
|
||
rpc ComputeAverage (stream ComputeAverageRequest) returns (ComputeAverageResponse){}; | ||
|
||
} | ||
rpc FindMaximum (stream FindMaximumRequest) returns (stream FindMaximumResponse); | ||
|
||
|
||
message GreetEveryoneRequest { | ||
Greeting greet = 1; | ||
// error handling | ||
// this RPC wil throw an exception if the sent number is negative: -1 | ||
rpc SquareRoot (SquareRootRequest) returns (SquareRootResponse) {}; | ||
|
||
} | ||
|
||
message GreetEveryoneResponse { | ||
string result = 1; | ||
message SquareRootRequest { | ||
int32 number= 1; | ||
} | ||
message LongGreetRequest { | ||
Greeting greet = 1; | ||
message SquareRootResponse { | ||
double number_root = 1; | ||
} | ||
|
||
message LongGreetResponse { | ||
string result = 1; | ||
message FindMaximumRequest { | ||
int32 number = 1; | ||
} | ||
|
||
message GreetManyTimesRequest { | ||
Greeting greeting = 1; | ||
message FindMaximumResponse { | ||
int32 maximum = 1; | ||
} | ||
|
||
message GreetManyTimesResponse { | ||
string result = 1; | ||
message ComputeAverageResponse { | ||
double average = 1; | ||
} | ||
message ComputeAverageRequest { | ||
int32 number = 1; | ||
} | ||
|
||
|
||
|
||
message Greeting { | ||
string first_name = 1; | ||
string last_name = 2; | ||
message PrimeNumberDecompositionRequest { | ||
int32 number = 1; | ||
} | ||
|
||
message GreetRequest { | ||
Greeting greeting = 1; | ||
message PrimeNumberDecompositionResponse { | ||
int32 prime_factor = 1; | ||
} | ||
|
||
message SumRequest { | ||
int32 first_number = 1; | ||
int32 second_number = 2; | ||
|
||
} | ||
|
||
message GreetResponse { | ||
string result = 1; | ||
message SumResponse { | ||
int32 sum_result = 1; | ||
} |
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