1// Copyright 2015 The 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// Message definitions to be used by integration test service definitions. 15 16syntax = "proto3"; 17 18import "google/protobuf/wrappers.proto"; 19 20package grpc.testing; 21 22option java_package = "io.grpc.testing.integration"; 23 24// DEPRECATED, don't use. To be removed shortly. 25// The type of payload that should be returned. 26enum PayloadType { 27 // Compressable text format. 28 COMPRESSABLE = 0; 29 30 // Uncompressable binary format. 31 UNCOMPRESSABLE = 1; 32 33 // Randomly chosen from all other formats defined in this enum. 34 RANDOM = 2; 35} 36 37// A block of data, to simply increase gRPC message size. 38message Payload { 39 // DEPRECATED, don't use. To be removed shortly. 40 // The type of data in body. 41 PayloadType type = 1; 42 // Primary contents of payload. 43 bytes body = 2; 44} 45 46// A protobuf representation for grpc status. This is used by test 47// clients to specify a status that the server should attempt to return. 48message EchoStatus { 49 int32 code = 1; 50 string message = 2; 51} 52 53// Unary request. 54message SimpleRequest { 55 // DEPRECATED, don't use. To be removed shortly. 56 // Desired payload type in the response from the server. 57 // If response_type is RANDOM, server randomly chooses one from other formats. 58 PayloadType response_type = 1; 59 60 // Desired payload size in the response from the server. 61 int32 response_size = 2; 62 63 // Optional input payload sent along with the request. 64 Payload payload = 3; 65 66 // Whether SimpleResponse should include username. 67 bool fill_username = 4; 68 69 // Whether SimpleResponse should include OAuth scope. 70 bool fill_oauth_scope = 5; 71 72 // Whether to request the server to compress the response. This field is 73 // "nullable" in order to interoperate seamlessly with clients not able to 74 // implement the full compression tests by introspecting the call to verify 75 // the response's compression status. 76 google.protobuf.BoolValue response_compressed = 6; 77 78 // Whether server should return a given status 79 EchoStatus response_status = 7; 80 81 // Whether the server should expect this request to be compressed. 82 google.protobuf.BoolValue expect_compressed = 8; 83} 84 85// Unary response, as configured by the request. 86message SimpleResponse { 87 // Payload to increase message size. 88 Payload payload = 1; 89 // The user the request came from, for verifying authentication was 90 // successful when the client expected it. 91 string username = 2; 92 // OAuth scope. 93 string oauth_scope = 3; 94} 95 96message SimpleContext { 97 string value = 1; 98} 99 100// Client-streaming request. 101message StreamingInputCallRequest { 102 // Optional input payload sent along with the request. 103 Payload payload = 1; 104 105 // Whether the server should expect this request to be compressed. This field 106 // is "nullable" in order to interoperate seamlessly with servers not able to 107 // implement the full compression tests by introspecting the call to verify 108 // the request's compression status. 109 google.protobuf.BoolValue expect_compressed = 2; 110 111 // Not expecting any payload from the response. 112} 113 114// Client-streaming response. 115message StreamingInputCallResponse { 116 // Aggregated size of payloads received from the client. 117 int32 aggregated_payload_size = 1; 118} 119 120// Configuration for a particular response. 121message ResponseParameters { 122 // Desired payload sizes in responses from the server. 123 int32 size = 1; 124 125 // Desired interval between consecutive responses in the response stream in 126 // microseconds. 127 int32 interval_us = 2; 128 129 // Whether to request the server to compress the response. This field is 130 // "nullable" in order to interoperate seamlessly with clients not able to 131 // implement the full compression tests by introspecting the call to verify 132 // the response's compression status. 133 google.protobuf.BoolValue compressed = 3; 134} 135 136// Server-streaming request. 137message StreamingOutputCallRequest { 138 // DEPRECATED, don't use. To be removed shortly. 139 // Desired payload type in the response from the server. 140 // If response_type is RANDOM, the payload from each response in the stream 141 // might be of different types. This is to simulate a mixed type of payload 142 // stream. 143 PayloadType response_type = 1; 144 145 // Configuration for each expected response message. 146 repeated ResponseParameters response_parameters = 2; 147 148 // Optional input payload sent along with the request. 149 Payload payload = 3; 150 151 // Whether server should return a given status 152 EchoStatus response_status = 7; 153} 154 155// Server-streaming response, as configured by the request and parameters. 156message StreamingOutputCallResponse { 157 // Payload to increase response size. 158 Payload payload = 1; 159} 160 161// For reconnect interop test only. 162// Client tells server what reconnection parameters it used. 163message ReconnectParams { 164 int32 max_reconnect_backoff_ms = 1; 165} 166 167// For reconnect interop test only. 168// Server tells client whether its reconnects are following the spec and the 169// reconnect backoffs it saw. 170message ReconnectInfo { 171 bool passed = 1; 172 repeated int32 backoff_ms = 2; 173} 174