-
Notifications
You must be signed in to change notification settings - Fork 50
/
service.proto
142 lines (120 loc) · 2.89 KB
/
service.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
syntax = "proto3";
package main;
option go_package = "./;main";
import "google/api/annotations.proto";
import "google/protobuf/empty.proto";
import "msg.proto";
message UnaryRequest {
int32 counter = 1;
}
message UnaryResponse {
int32 result = 1;
}
message BinaryRequest {
bytes data = 1;
}
message BinaryResponse {
bytes data = 1;
}
message StreamingRequest {
int32 counter = 1;
}
message StreamingResponse {
int32 result = 1;
}
message HttpGetRequest {
int32 num_to_increase = 1;
}
message HttpGetResponse {
int32 result = 1;
}
message HttpPostRequest {
int32 a = 1;
PostRequest req = 2;
int32 c = 3;
}
message PostRequest {
int32 b = 1;
}
message HttpPostResponse {
int32 post_result = 1;
}
message HttpPatchRequest {
int32 a = 1;
int32 c = 2;
}
message HttpPatchResponse {
int32 patch_result = 2;
}
message HttpDeleteRequest {
int32 a = 1;
}
message HTTPGetWithURLSearchParamsRequest {
int32 a = 1;
PostRequest post_req = 2;
repeated int32 c = 3;
ExternalMessage ext_msg = 4;
}
message HTTPGetWithURLSearchParamsResponse {
int32 url_search_params_result = 1;
}
message ZeroValueMsg {
int32 c = 1;
repeated int32 d = 2;
bool e = 3;
}
message HTTPGetWithZeroValueURLSearchParamsRequest {
string a = 1;
string b = 2;
ZeroValueMsg zero_value_msg = 3;
}
message HTTPGetWithZeroValueURLSearchParamsResponse {
string a = 1;
string b = 2;
ZeroValueMsg zero_value_msg = 3;
}
service CounterService {
rpc Increment(UnaryRequest) returns (UnaryResponse);
rpc StreamingIncrements(StreamingRequest) returns (stream StreamingResponse);
rpc FailingIncrement(UnaryRequest) returns (UnaryResponse);
rpc EchoBinary(BinaryRequest) returns (BinaryResponse);
rpc HTTPGet(HttpGetRequest) returns (HttpGetResponse) {
option (google.api.http) = {
get: "/api/{num_to_increase}"
};
}
rpc HTTPPostWithNestedBodyPath(HttpPostRequest) returns (HttpPostResponse) {
option (google.api.http) = {
post: "/post/{a}"
body: "req"
};
}
rpc HTTPPostWithStarBodyPath(HttpPostRequest) returns (HttpPostResponse) {
option (google.api.http) = {
post: "/post/{a}/{c}"
body: "*"
};
}
rpc HTTPPatch(HttpPatchRequest) returns (HttpPatchResponse) {
option (google.api.http) = {
patch: "/patch"
body: "*"
};
}
rpc HTTPDelete(HttpDeleteRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/delete/{a}"
};
}
rpc ExternalMessage(ExternalRequest) returns (ExternalResponse);
rpc HTTPGetWithURLSearchParams(HTTPGetWithURLSearchParamsRequest) returns (HTTPGetWithURLSearchParamsResponse) {
option (google.api.http) = {
get: "/api/query/{a}"
};
}
rpc HTTPGetWithZeroValueURLSearchParams(HTTPGetWithZeroValueURLSearchParamsRequest) returns (HTTPGetWithZeroValueURLSearchParamsResponse) {
option (google.api.http) = {
get: "/path/query"
};
}
}