-
Notifications
You must be signed in to change notification settings - Fork 37
/
sum.proto
34 lines (29 loc) · 830 Bytes
/
sum.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
syntax = "proto3";
package sumpb;
option go_package="sumpb";
// uncomment for inline HTTP desc google.api.http
import "google/api/annotations.proto";
service Summator {
rpc Sum(SumRequest) returns (SumResponse) {
option (google.api.http) = {
// uncomment get or post+body or use YAML annotation
//get: "/v1/example/sum/{a}/{b}"
post: "/v1/example/sum/{a}"
body: "b"
};
}
}
// SumRequest is a request for Summator service.
message SumRequest {
// A is the number we're adding to. Can't be zero for the sake of example.
int64 a = 1;
// B is the number we're adding.
NestedB b = 2;
}
message SumResponse {
int64 sum = 1;
string error = 2;
}
message NestedB {
int64 b = 1;
}