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