Khen Nursimulu | d768809 | 2016-11-17 00:08:57 -0500 | [diff] [blame] | 1 | syntax = "proto3"; |
| 2 | |
| 3 | package experiment; |
| 4 | |
| 5 | //import "google/protobuf/empty.proto"; |
| 6 | |
| 7 | message AsyncEvent { |
| 8 | int32 seq = 1; |
| 9 | enum EventType { |
| 10 | BIG_BANG = 0; // just a big bang |
| 11 | SMALL_BANG = 1; // so small bang |
| 12 | NO_BANG = 2; |
| 13 | } |
| 14 | EventType type = 2; |
| 15 | string details = 3; |
| 16 | } |
| 17 | |
| 18 | enum khenType { |
| 19 | BIG_KHEN = 0; |
| 20 | SMALL_KHEN = 1; |
| 21 | NO_KHEN = 2; |
| 22 | } |
| 23 | |
| 24 | |
| 25 | message Packet { |
| 26 | int32 source = 1; |
| 27 | bytes content = 2; |
| 28 | message Result { |
| 29 | string url = 1; |
| 30 | string title = 2; |
| 31 | repeated string snippets = 3; |
| 32 | message Success { |
| 33 | string input = 1; |
| 34 | string desc = 2; |
| 35 | } |
| 36 | repeated Success success = 4; |
| 37 | } |
| 38 | repeated Result results = 3; |
| 39 | } |
| 40 | |
| 41 | message Echo { |
| 42 | string msg = 1; |
| 43 | float delay = 2; |
| 44 | } |
| 45 | |
| 46 | message testMessage{ |
| 47 | oneof oneOfTest { |
| 48 | string test2 = 1; |
| 49 | int32 test3 = 2; |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | service ExperimentalService { |
| 54 | |
| 55 | rpc GetEcho(Echo) returns(Echo); |
| 56 | |
| 57 | // For server to send async stream to client |
| 58 | rpc ReceiveStreamedEvents(Packet) |
| 59 | returns(stream AsyncEvent); |
| 60 | |
| 61 | // For server to send async packets to client |
| 62 | rpc ReceivePackets(Echo) returns(stream Packet); |
| 63 | |
| 64 | // For client to send async packets to server |
| 65 | rpc SendPackets(stream Packet) returns(Echo); |
| 66 | |
| 67 | } |