-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.proto
102 lines (83 loc) · 1.84 KB
/
main.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
syntax = "proto3";
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
/*
* ServerInfo Service
*/
service ServerInfoService {
rpc info(google.protobuf.Empty) returns (ServerInfo) {}
}
message ServerInfo {
string version = 1;
google.protobuf.Timestamp lastShutdown = 2;
google.protobuf.Timestamp startedAt = 3;
}
/*
* PushService
*/
service PushService {
rpc add(TokenRequest) returns (google.protobuf.Empty) {}
rpc invite(InvitationRequest) returns (stream InvitationResponse) {}
}
// mclient token --add 123 --handle oliver
message TokenRequest {
string token = 1;
string handle = 2;
}
message Handle {
string value = 1;
repeated string tokens = 2;
}
// mclient token --invite "maike matz" --sessionid 123
message InvitationRequest {
string from = 1; // change to synonym of "inviting person"
repeated string to = 2; // change to recipients, should really be plural
bytes payload = 3;
}
message InvitationResponse {
int32 code = 1;
string message = 2;
}
message APNConfig {
string key = 1;
string keyIdentifier = 2;
string teamIdentifier = 3;
string topic = 4;
enum Environment {
PRODUCTION = 0;
SANDBOX = 1;
};
Environment environment = 5;
}
/*
* AddressBook Service
*/
service AddressBookService {
rpc list(google.protobuf.Empty) returns (stream Handle) {}
}
/*
* Signal Service
*/
service SignalService {
rpc signal(stream Signal) returns (stream Signal) {}
}
message Signal {
oneof type {
Connect connect = 1;
Broadcast broadcast = 2;
Error error = 3;
}
}
message Connect {
string from = 1;
string sessionId = 2;
bool connected = 3;
}
message Broadcast {
string sessionId = 1;
bytes payload = 2;
}
message Error {
int32 code = 1;
string message = 2;
}