Khen Nursimulu | d768809 | 2016-11-17 00:08:57 -0500 | [diff] [blame] | 1 | syntax = "proto3"; |
| 2 | |
| 3 | package experiment; |
| 4 | |
Khen Nursimulu | d768809 | 2016-11-17 00:08:57 -0500 | [diff] [blame] | 5 | message 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 Nursimulu | 95b919d | 2016-11-18 16:20:20 -0500 | [diff] [blame] | 16 | enum SimpleEnum { |
| 17 | APPLE = 0; |
| 18 | BANANA = 1; |
| 19 | ORANGE = 2; |
Khen Nursimulu | d768809 | 2016-11-17 00:08:57 -0500 | [diff] [blame] | 20 | } |
| 21 | |
Khen Nursimulu | d768809 | 2016-11-17 00:08:57 -0500 | [diff] [blame] | 22 | message Packet { |
| 23 | int32 source = 1; |
| 24 | bytes content = 2; |
Khen Nursimulu | 95b919d | 2016-11-18 16:20:20 -0500 | [diff] [blame] | 25 | message InnerPacket { |
Khen Nursimulu | d768809 | 2016-11-17 00:08:57 -0500 | [diff] [blame] | 26 | string url = 1; |
| 27 | string title = 2; |
| 28 | repeated string snippets = 3; |
Khen Nursimulu | 95b919d | 2016-11-18 16:20:20 -0500 | [diff] [blame] | 29 | message InnerInnerPacket { |
Khen Nursimulu | d768809 | 2016-11-17 00:08:57 -0500 | [diff] [blame] | 30 | string input = 1; |
| 31 | string desc = 2; |
| 32 | } |
Khen Nursimulu | 95b919d | 2016-11-18 16:20:20 -0500 | [diff] [blame] | 33 | repeated InnerInnerPacket inner_inner_packet = 4; |
Khen Nursimulu | d768809 | 2016-11-17 00:08:57 -0500 | [diff] [blame] | 34 | } |
Khen Nursimulu | 95b919d | 2016-11-18 16:20:20 -0500 | [diff] [blame] | 35 | repeated InnerPacket inner_packets = 3; |
Khen Nursimulu | d768809 | 2016-11-17 00:08:57 -0500 | [diff] [blame] | 36 | } |
| 37 | |
| 38 | message Echo { |
| 39 | string msg = 1; |
| 40 | float delay = 2; |
| 41 | } |
| 42 | |
| 43 | message testMessage{ |
| 44 | oneof oneOfTest { |
| 45 | string test2 = 1; |
| 46 | int32 test3 = 2; |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | service 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 | } |