-
Notifications
You must be signed in to change notification settings - Fork 20
/
calculator.proto
62 lines (45 loc) · 963 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
53
54
55
56
57
58
59
60
61
62
syntax = "proto3";
option java_package = "calculator.grpc";
package calculator;
service Calculator {
rpc Add (AddRequest) returns (AddResponse) {}
rpc Sub (SubRequest) returns (SubResponse) {}
rpc Mul (MulRequest) returns (MulResponse) {}
rpc Div (DivRequest) returns (DivResponse) {}
rpc Mod (ModRequest) returns (ModResponse) {}
}
message AddRequest {
int32 addend_1 = 1;
int32 addend_2 = 2;
}
message AddResponse {
int64 sum = 1;
}
message SubRequest {
int32 minuend = 1;
int32 subtrahend = 2;
}
message SubResponse {
int64 difference = 1;
}
message MulRequest {
int32 multiplicand = 1;
int32 multiplier = 2;
}
message MulResponse {
int64 product = 1;
}
message DivRequest {
int32 dividend = 1;
int32 divisor = 2;
}
message DivResponse {
int64 quotient = 1;
}
message ModRequest {
int32 dividend = 1;
int32 divisor = 2;
}
message ModResponse {
int64 result = 1;
}