-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhello_bilibili.proto
68 lines (51 loc) · 1.59 KB
/
hello_bilibili.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
syntax = "proto3";
package test;
service Bibili {
rpc HelloDewei(HelloDeweiReq) returns (HelloDeweiReply){}
rpc HelloTest(stream HelloTestRequest) returns (stream HelloTestResponse){}
rpc TestClientRecvStream(TestClientRecvStreamReq) returns (stream TestClientRecvStreamResponse){}
rpc TestClientSendStream(stream TestClientSendStreamRequest) returns (TestClientSendStreamResponse){}
rpc TestTwoWayStream(stream TestTwoWayStreamRequest) returns (stream TestTwoWayStreamResponse){}
}
// 传输方式
// 1: unary 单程
// 2: stream 1: 双向 客户端请求服务器端(流),服务器端请求客户端(流)
// 2: 单向 服务器端接收到客户端(流),服务器端返回客户端(非流)
// 3: 单向 服务器端接收到客户端(非流),服务器端send给客户端(流)
message HelloDeweiReq {
string name = 1;
int32 age = 2;
}
message HelloDeweiReply {
string result = 1;
}
message HelloTestRequest {
string name = 1;
int64 age = 2;
repeated string data = 3;
message HelloTestRequestNumberValue {
string name = 1;
int32 age = 2;
bool is_active = 3;
}
map<string, HelloTestRequestNumberValue> number = 4; // string, int32, bool
}
message HelloTestResponse {}
message TestClientRecvStreamReq {
string data = 1;
}
message TestClientRecvStreamResponse {
string result = 1;
}
message TestClientSendStreamRequest {
string data = 1;
}
message TestClientSendStreamResponse {
string result = 1;
}
message TestTwoWayStreamRequest {
string data = 1;
}
message TestTwoWayStreamResponse {
string result = 1;
}