• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2015 The gRPC Authors
2// All rights reserved.
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8//     http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16// A simple service definition for testing the protoc plugin.
17syntax = "proto3";
18
19package grpc.testing.compiler;
20
21option java_package = "io.grpc.testing.compiler";
22
23message SimpleRequest {
24}
25
26message SimpleResponse {
27}
28
29message StreamingInputCallRequest {
30}
31
32message StreamingInputCallResponse {
33}
34
35message StreamingOutputCallRequest {
36}
37
38message StreamingOutputCallResponse {
39}
40
41// Test service that supports all call types.
42service TestService {
43  // One request followed by one response.
44  // The server returns the client payload as-is.
45  rpc UnaryCall(SimpleRequest) returns (SimpleResponse);
46
47  // One request followed by a sequence of responses (streamed download).
48  // The server returns the payload with client desired type and sizes.
49  rpc StreamingOutputCall(StreamingOutputCallRequest)
50      returns (stream StreamingOutputCallResponse);
51
52  // A sequence of requests followed by one response (streamed upload).
53  // The server returns the aggregated size of client payload as the result.
54  rpc StreamingInputCall(stream StreamingInputCallRequest)
55      returns (StreamingInputCallResponse);
56
57  // A sequence of requests with each request served by the server immediately.
58  // As one request could lead to multiple responses, this interface
59  // demonstrates the idea of full bidirectionality.
60  rpc FullBidiCall(stream StreamingOutputCallRequest)
61      returns (stream StreamingOutputCallResponse);
62
63  // A sequence of requests followed by a sequence of responses.
64  // The server buffers all the client requests and then serves them in order. A
65  // stream of responses are returned to the client when the server starts with
66  // first request.
67  rpc HalfBidiCall(stream StreamingOutputCallRequest)
68      returns (stream StreamingOutputCallResponse);
69
70  // An RPC method whose Java name collides with a keyword, and whose generated
71  // method should have a '_' appended.
72  rpc Import(stream StreamingInputCallRequest) returns (stream StreamingInputCallResponse);
73}
74
75// Test service that has been deprecated and should generate with Java's @Deprecated annotation
76service TestDeprecatedService {
77  option deprecated = true;
78
79  // An RPC method that has been deprecated and should generate with Java's @Deprecated annotation
80  rpc DeprecatedMethod(SimpleRequest) returns (SimpleResponse) {
81    option deprecated = true;
82  }
83}