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.
44 message SimpleRequest {
45 // Desired payload type in the response from the server.
46 // If response_type is RANDOM, server randomly chooses one from other formats.
47 PayloadType response_type = 1;
49 // Desired payload size in the response from the server.
50 // If response_type is COMPRESSABLE, this denotes the size before compression.
51 int32 response_size = 2;
53 // Optional input payload sent along with the request.
56 // Whether SimpleResponse should include username.
57 bool fill_username = 4;
59 // Whether SimpleResponse should include OAuth scope.
60 bool fill_oauth_scope = 5;
63 // Unary response, as configured by the request.
64 message SimpleResponse {
65 // Payload to increase message size.
68 // The user the request came from, for verifying authentication was
69 // successful when the client expected it.
73 string oauth_scope = 3;
76 // Client-streaming request.
77 message StreamingInputCallRequest {
78 // Optional input payload sent along with the request.
81 // Not expecting any payload from the response.
84 // Client-streaming response.
85 message StreamingInputCallResponse {
86 // Aggregated size of payloads received from the client.
87 int32 aggregated_payload_size = 1;
90 // Configuration for a particular response.
91 message ResponseParameters {
92 // Desired payload sizes in responses from the server.
93 // If response_type is COMPRESSABLE, this denotes the size before compression.
96 // Desired interval between consecutive responses in the response stream in
98 int32 interval_us = 2;
101 // Server-streaming request.
102 message StreamingOutputCallRequest {
103 // Desired payload type in the response from the server.
104 // If response_type is RANDOM, the payload from each response in the stream
105 // might be of different types. This is to simulate a mixed type of payload
107 PayloadType response_type = 1;
109 // Configuration for each expected response message.
110 repeated ResponseParameters response_parameters = 2;
112 // Optional input payload sent along with the request.
116 // Server-streaming response, as configured by the request and parameters.
117 message StreamingOutputCallResponse {
118 // Payload to increase response size.
122 // A simple service to test the various types of RPCs and experiment with
123 // performance with various types of payload.
124 service TestService {
125 // One empty request followed by one empty response.
126 rpc EmptyCall(Empty) returns (Empty);
128 // One request followed by one response.
129 // The server returns the client payload as-is.
130 rpc UnaryCall(SimpleRequest) returns (SimpleResponse);
132 // One request followed by a sequence of responses (streamed download).
133 // The server returns the payload with client desired type and sizes.
134 rpc StreamingOutputCall(StreamingOutputCallRequest)
135 returns (stream StreamingOutputCallResponse);
137 // A sequence of requests followed by one response (streamed upload).
138 // The server returns the aggregated size of client payload as the result.
139 rpc StreamingInputCall(stream StreamingInputCallRequest)
140 returns (StreamingInputCallResponse);
142 // A sequence of requests with each request served by the server immediately.
143 // As one request could lead to multiple responses, this interface
144 // demonstrates the idea of full duplexing.
145 rpc FullDuplexCall(stream StreamingOutputCallRequest)
146 returns (stream StreamingOutputCallResponse);
148 // A sequence of requests followed by a sequence of responses.
149 // The server buffers all the client requests and then serves them in order. A
150 // stream of responses are returned to the client when the server starts with
152 rpc HalfDuplexCall(stream StreamingOutputCallRequest)
153 returns (stream StreamingOutputCallResponse);