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