blob: 718951cd9f923289f0dba0e5322ede115707ff51 [file] [log] [blame]
Khen Nursimulud7688092016-11-17 00:08:57 -05001syntax = "proto3";
2
3package experiment;
4
Khen Nursimulud7688092016-11-17 00:08:57 -05005message AsyncEvent {
6 int32 seq = 1;
7 enum EventType {
8 BIG_BANG = 0; // just a big bang
9 SMALL_BANG = 1; // so small bang
10 NO_BANG = 2;
11 }
12 EventType type = 2;
13 string details = 3;
14}
15
Khen Nursimulu95b919d2016-11-18 16:20:20 -050016enum SimpleEnum {
17 APPLE = 0;
18 BANANA = 1;
19 ORANGE = 2;
Khen Nursimulud7688092016-11-17 00:08:57 -050020}
21
Khen Nursimulud7688092016-11-17 00:08:57 -050022message Packet {
23 int32 source = 1;
24 bytes content = 2;
Khen Nursimulu95b919d2016-11-18 16:20:20 -050025 message InnerPacket {
Khen Nursimulud7688092016-11-17 00:08:57 -050026 string url = 1;
27 string title = 2;
28 repeated string snippets = 3;
Khen Nursimulu95b919d2016-11-18 16:20:20 -050029 message InnerInnerPacket {
Khen Nursimulud7688092016-11-17 00:08:57 -050030 string input = 1;
31 string desc = 2;
32 }
Khen Nursimulu95b919d2016-11-18 16:20:20 -050033 repeated InnerInnerPacket inner_inner_packet = 4;
Khen Nursimulud7688092016-11-17 00:08:57 -050034 }
Khen Nursimulu95b919d2016-11-18 16:20:20 -050035 repeated InnerPacket inner_packets = 3;
Khen Nursimulud7688092016-11-17 00:08:57 -050036}
37
38message Echo {
39 string msg = 1;
40 float delay = 2;
41}
42
43message testMessage{
44 oneof oneOfTest {
45 string test2 = 1;
46 int32 test3 = 2;
47 }
48}
49
50service ExperimentalService {
51
52 rpc GetEcho(Echo) returns(Echo);
53
54 // For server to send async stream to client
55 rpc ReceiveStreamedEvents(Packet)
56 returns(stream AsyncEvent);
57
58 // For server to send async packets to client
59 rpc ReceivePackets(Echo) returns(stream Packet);
60
61 // For client to send async packets to server
62 rpc SendPackets(stream Packet) returns(Echo);
63
64}