-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuser.proto
55 lines (41 loc) · 1.23 KB
/
user.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
syntax = "proto3";
package usercontroller;
import "validator.proto";
import "method_option.proto";
service User {
rpc RegisterUser(UserRegisterRequest) returns (UserRegisterResponse) {
option (pbbase.option_base).ignore_token_verify = true;
}
rpc GetConnectedUsers(Empty) returns (stream UserInfo) {
option (pbbase.option_base).tx_option = ReadOnly;
}
rpc ReceiveDlcMessages(Empty) returns (stream DlcMessage) {
option (pbbase.option_base).tx_option = ReadOnly;
}
rpc SendDlcMessage(DlcMessage) returns (Empty) {
option (pbbase.option_base).tx_option = ReadOnly;
}
rpc GetUserList(Empty) returns (stream UserInfo) {
option (pbbase.option_base).tx_option = ReadOnly;
}
rpc UnregisterUser(UnregisterUserRequest) returns (Empty) {}
}
message Empty {}
message UserInfo {
string name = 1;
}
message UserRegisterRequest {
string name = 1 [(validator.field) = {string_not_empty: true}];
string password = 2 [(validator.field) = {string_not_empty: true}];
}
message UserRegisterResponse {
string id = 1;
string name = 2;
}
message UnregisterUserRequest {
}
message DlcMessage {
string dest_name = 1;
string org_name = 2;
bytes payload = 3;
}