• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1
2// Copyright 2015-2016 gRPC authors.
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// An integration test service that covers all the method signature permutations
17// of unary/streaming requests/responses.
18
19syntax = "proto3";
20
21import "src/proto/grpc/testing/empty.proto";
22import "src/proto/grpc/testing/messages.proto";
23
24package grpc.testing;
25
26// A simple service to test the various types of RPCs and experiment with
27// performance with various types of payload.
28service TestService {
29  // One empty request followed by one empty response.
30  rpc EmptyCall(grpc.testing.Empty) returns (grpc.testing.Empty);
31
32  // One request followed by one response.
33  rpc UnaryCall(SimpleRequest) returns (SimpleResponse);
34
35  // One request followed by one response. Response has cache control
36  // headers set such that a caching HTTP proxy (such as GFE) can
37  // satisfy subsequent requests.
38  rpc CacheableUnaryCall(SimpleRequest) returns (SimpleResponse);
39
40  // One request followed by a sequence of responses (streamed download).
41  // The server returns the payload with client desired type and sizes.
42  rpc StreamingOutputCall(StreamingOutputCallRequest)
43      returns (stream StreamingOutputCallResponse);
44
45  // A sequence of requests followed by one response (streamed upload).
46  // The server returns the aggregated size of client payload as the result.
47  rpc StreamingInputCall(stream StreamingInputCallRequest)
48      returns (StreamingInputCallResponse);
49
50  // A sequence of requests with each request served by the server immediately.
51  // As one request could lead to multiple responses, this interface
52  // demonstrates the idea of full duplexing.
53  rpc FullDuplexCall(stream StreamingOutputCallRequest)
54      returns (stream StreamingOutputCallResponse);
55
56  // A sequence of requests followed by a sequence of responses.
57  // The server buffers all the client requests and then serves them in order. A
58  // stream of responses are returned to the client when the server starts with
59  // first request.
60  rpc HalfDuplexCall(stream StreamingOutputCallRequest)
61      returns (stream StreamingOutputCallResponse);
62
63  // The test server will not implement this method. It will be used
64  // to test the behavior when clients call unimplemented methods.
65  rpc UnimplementedCall(grpc.testing.Empty) returns (grpc.testing.Empty);
66}
67
68// A simple service NOT implemented at servers so clients can test for
69// that case.
70service UnimplementedService {
71  // A call that no server should implement
72  rpc UnimplementedCall(grpc.testing.Empty) returns (grpc.testing.Empty);
73}
74
75// A service used to control reconnect server.
76service ReconnectService {
77  rpc Start(grpc.testing.ReconnectParams) returns (grpc.testing.Empty);
78  rpc Stop(grpc.testing.Empty) returns (grpc.testing.ReconnectInfo);
79}
80