-
Notifications
You must be signed in to change notification settings - Fork 2.3k
/
Copy pathresponse_body_service.proto
65 lines (57 loc) · 1.37 KB
/
response_body_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
syntax = "proto3";
option go_package = "github.com/grpc-ecosystem/grpc-gateway/v2/examples/internal/proto/examplepb";
package grpc.gateway.examples.internal.proto.examplepb;
import "google/api/annotations.proto";
message ResponseBodyIn {
string data = 1;
}
message ResponseBodyOut {
message Response {
string data = 1;
}
Response response = 2;
}
message RepeatedResponseBodyOut {
message Response {
string data = 1;
enum ResponseType {
// UNKNOWN
UNKNOWN = 0;
// A is 1
A = 1;
// B is 2
B = 2;
}
ResponseType type = 3;
}
repeated Response response = 2;
}
message RepeatedResponseStrings {
repeated string values = 1;
}
service ResponseBodyService {
rpc GetResponseBody(ResponseBodyIn) returns (ResponseBodyOut) {
option (google.api.http) = {
get : "/responsebody/{data}"
response_body : "response"
};
}
rpc ListResponseBodies(ResponseBodyIn) returns (RepeatedResponseBodyOut) {
option (google.api.http) = {
get : "/responsebodies/{data}"
response_body : "response"
};
}
rpc ListResponseStrings(ResponseBodyIn) returns (RepeatedResponseStrings) {
option (google.api.http) = {
get : "/responsestrings/{data}"
response_body : "values"
};
}
rpc GetResponseBodyStream(ResponseBodyIn) returns (stream ResponseBodyOut) {
option (google.api.http) = {
get : "/responsebody/stream/{data}"
response_body : "response"
};
}
}