Eric Anderson | 99a6d8d | 2016-03-22 11:31:36 -0700 | [diff] [blame] | 1 | // A simple service definition for testing the protoc plugin. |
| 2 | syntax = "proto2"; |
| 3 | |
Eric Anderson | b22bcdf | 2016-03-29 14:13:28 -0700 | [diff] [blame] | 4 | package grpc.testing; |
Eric Anderson | 99a6d8d | 2016-03-22 11:31:36 -0700 | [diff] [blame] | 5 | |
Eric Anderson | b22bcdf | 2016-03-29 14:13:28 -0700 | [diff] [blame] | 6 | option java_package = "io.grpc.testing.integration"; |
Eric Anderson | 99a6d8d | 2016-03-22 11:31:36 -0700 | [diff] [blame] | 7 | option optimize_for = LITE_RUNTIME; |
| 8 | |
| 9 | message SimpleRequest { |
| 10 | } |
| 11 | |
| 12 | message SimpleResponse { |
| 13 | } |
| 14 | |
| 15 | message StreamingInputCallRequest { |
| 16 | } |
| 17 | |
| 18 | message StreamingInputCallResponse { |
| 19 | } |
| 20 | |
| 21 | message StreamingOutputCallRequest { |
| 22 | } |
| 23 | |
| 24 | message StreamingOutputCallResponse { |
| 25 | } |
| 26 | |
nmittler | 7e8b504 | 2016-04-15 12:52:00 -0700 | [diff] [blame] | 27 | // Test service that supports all call types. |
Eric Anderson | 99a6d8d | 2016-03-22 11:31:36 -0700 | [diff] [blame] | 28 | service TestService { |
| 29 | // One request followed by one response. |
| 30 | // The server returns the client payload as-is. |
| 31 | rpc UnaryCall(SimpleRequest) returns (SimpleResponse); |
| 32 | |
| 33 | // One request followed by a sequence of responses (streamed download). |
| 34 | // The server returns the payload with client desired type and sizes. |
| 35 | rpc StreamingOutputCall(StreamingOutputCallRequest) |
| 36 | returns (stream StreamingOutputCallResponse); |
| 37 | |
| 38 | // A sequence of requests followed by one response (streamed upload). |
| 39 | // The server returns the aggregated size of client payload as the result. |
| 40 | rpc StreamingInputCall(stream StreamingInputCallRequest) |
| 41 | returns (StreamingInputCallResponse); |
| 42 | |
| 43 | // A sequence of requests with each request served by the server immediately. |
| 44 | // As one request could lead to multiple responses, this interface |
| 45 | // demonstrates the idea of full bidirectionality. |
| 46 | rpc FullBidiCall(stream StreamingOutputCallRequest) |
| 47 | returns (stream StreamingOutputCallResponse); |
| 48 | |
| 49 | // A sequence of requests followed by a sequence of responses. |
| 50 | // The server buffers all the client requests and then serves them in order. A |
| 51 | // stream of responses are returned to the client when the server starts with |
| 52 | // first request. |
| 53 | rpc HalfBidiCall(stream StreamingOutputCallRequest) |
| 54 | returns (stream StreamingOutputCallResponse); |
| 55 | } |