| 1 |
// Copyright 2016 gRPC authors. |
| 2 |
// |
| 3 |
// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 |
// you may not use this file except in compliance with the License. |
| 5 |
// You may obtain a copy of the License at |
| 6 |
// |
| 7 |
// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
// |
| 9 |
// Unless required by applicable law or agreed to in writing, software |
| 10 |
// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 |
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 |
// See the License for the specific language governing permissions and |
| 13 |
// limitations under the License. |
| 14 |
|
| 15 |
syntax = "proto3"; |
| 16 |
|
| 17 |
import "tests/protoc_plugin/protos/requests/r/test_requests.proto"; |
| 18 |
import "tests/protoc_plugin/protos/responses/test_responses.proto"; |
| 19 |
|
| 20 |
package grpc_protoc_plugin; |
| 21 |
|
| 22 |
service TestService { |
| 23 |
// One request followed by one response. |
| 24 |
// The server returns the client payload as-is. |
| 25 |
rpc UnaryCall(SimpleRequest) returns (SimpleResponse); |
| 26 |
|
| 27 |
// One request followed by a sequence of responses (streamed download). |
| 28 |
// The server returns the payload with client desired type and sizes. |
| 29 |
rpc StreamingOutputCall(StreamingOutputCallRequest) |
| 30 |
returns (stream StreamingOutputCallResponse); |
| 31 |
|
| 32 |
// A sequence of requests followed by one response (streamed upload). |
| 33 |
// The server returns the aggregated size of client payload as the result. |
| 34 |
rpc StreamingInputCall(stream StreamingInputCallRequest) |
| 35 |
returns (StreamingInputCallResponse); |
| 36 |
|
| 37 |
// A sequence of requests with each request served by the server immediately. |
| 38 |
// As one request could lead to multiple responses, this interface |
| 39 |
// demonstrates the idea of full duplexing. |
| 40 |
rpc FullDuplexCall(stream StreamingOutputCallRequest) |
| 41 |
returns (stream StreamingOutputCallResponse); |
| 42 |
|
| 43 |
// A sequence of requests followed by a sequence of responses. |
| 44 |
// The server buffers all the client requests and then serves them in order. A |
| 45 |
// stream of responses are returned to the client when the server starts with |
| 46 |
// first request. |
| 47 |
rpc HalfDuplexCall(stream StreamingOutputCallRequest) |
| 48 |
returns (stream StreamingOutputCallResponse); |
| 49 |
} |