1 // Copyright 2017 gRPC authors.
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
7 // http://www.apache.org/licenses/LICENSE-2.0
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.
15 // An integration test service that covers all the method signature permutations
16 // of unary/streaming requests/responses.
23 // The type of payload that should be returned.
25 // Compressable text format.
28 // Uncompressable binary format.
31 // Randomly chosen from all other formats defined in this enum.
35 // A block of data, to simply increase gRPC message size.
37 // The type of data in body.
39 // Primary contents of payload.
43 // A protobuf representation for grpc status. This is used by test
44 // clients to specify a status that the server should attempt to return.
51 message SimpleRequest {
52 // Desired payload type in the response from the server.
53 // If response_type is RANDOM, server randomly chooses one from other formats.
54 PayloadType response_type = 1;
56 // Desired payload size in the response from the server.
57 // If response_type is COMPRESSABLE, this denotes the size before compression.
58 int32 response_size = 2;
60 // Optional input payload sent along with the request.
63 // Whether SimpleResponse should include username.
64 bool fill_username = 4;
66 // Whether SimpleResponse should include OAuth scope.
67 bool fill_oauth_scope = 5;
69 // Whether server should return a given status
70 EchoStatus response_status = 7;
73 // Unary response, as configured by the request.
74 message SimpleResponse {
75 // Payload to increase message size.
78 // The user the request came from, for verifying authentication was
79 // successful when the client expected it.
83 string oauth_scope = 3;
86 // Client-streaming request.
87 message StreamingInputCallRequest {
88 // Optional input payload sent along with the request.
91 // Not expecting any payload from the response.
94 // Client-streaming response.
95 message StreamingInputCallResponse {
96 // Aggregated size of payloads received from the client.
97 int32 aggregated_payload_size = 1;
100 // Configuration for a particular response.
101 message ResponseParameters {
102 // Desired payload sizes in responses from the server.
103 // If response_type is COMPRESSABLE, this denotes the size before compression.
106 // Desired interval between consecutive responses in the response stream in
108 int32 interval_us = 2;
111 // Server-streaming request.
112 message StreamingOutputCallRequest {
113 // Desired payload type in the response from the server.
114 // If response_type is RANDOM, the payload from each response in the stream
115 // might be of different types. This is to simulate a mixed type of payload
117 PayloadType response_type = 1;
119 // Configuration for each expected response message.
120 repeated ResponseParameters response_parameters = 2;
122 // Optional input payload sent along with the request.
125 // Whether server should return a given status
126 EchoStatus response_status = 7;
129 // Server-streaming response, as configured by the request and parameters.
130 message StreamingOutputCallResponse {
131 // Payload to increase response size.
135 // A simple service to test the various types of RPCs and experiment with
136 // performance with various types of payload.
137 service TestService {
138 // One empty request followed by one empty response.
139 rpc EmptyCall(Empty) returns (Empty);
141 // One request followed by one response.
142 // The server returns the client payload as-is.
143 rpc UnaryCall(SimpleRequest) returns (SimpleResponse);
145 // One request followed by a sequence of responses (streamed download).
146 // The server returns the payload with client desired type and sizes.
147 rpc StreamingOutputCall(StreamingOutputCallRequest)
148 returns (stream StreamingOutputCallResponse);
150 // A sequence of requests followed by one response (streamed upload).
151 // The server returns the aggregated size of client payload as the result.
152 rpc StreamingInputCall(stream StreamingInputCallRequest)
153 returns (StreamingInputCallResponse);
155 // A sequence of requests with each request served by the server immediately.
156 // As one request could lead to multiple responses, this interface
157 // demonstrates the idea of full duplexing.
158 rpc FullDuplexCall(stream StreamingOutputCallRequest)
159 returns (stream StreamingOutputCallResponse);
161 // A sequence of requests followed by a sequence of responses.
162 // The server buffers all the client requests and then serves them in order. A
163 // stream of responses are returned to the client when the server starts with
165 rpc HalfDuplexCall(stream StreamingOutputCallRequest)
166 returns (stream StreamingOutputCallResponse);
169 // A simple service NOT implemented at servers so clients can test for
171 service UnimplementedService {
172 // A call that no server should implement
173 rpc UnimplementedCall(grpc.testing.Empty) returns (grpc.testing.Empty);