-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcalculator.proto
53 lines (36 loc) · 864 Bytes
/
calculator.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
syntax = "proto3";
package calculator;
option go_package = "calculatorproto";
message SumReq {
int32 first_num = 1;
int32 second_num = 2;
}
message SumRes {
int32 result = 1;
}
message ComputeAvarageReq{
int64 num = 1;
}
message ComputeAvarageRes{
double result = 1;
}
message FindMaximumRequest{
int64 num = 1;
}
message FindMaximumResponse{
int64 result = 1;
}
message SquareRootRequest{
int32 num = 1;
}
message SquareRootResponse{
double num_root = 1;
}
service calculatorService{
rpc Sum(SumReq) returns (SumRes){};
// Client Streaming
rpc ComputeAvarage (stream ComputeAvarageReq) returns (ComputeAvarageRes){};
// BiDi Streaming
rpc FindMaximum(stream FindMaximumRequest) returns (stream FindMaximumResponse){};
rpc SquareRoot(SquareRootRequest)returns (SquareRootResponse){};
}