Home | History | Annotate | Download | only in RemoteTestClient
      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 // The type of payload that should be returned.
     24 enum PayloadType {
     25   // Compressable text format.
     26   COMPRESSABLE = 0;
     27 
     28   // Uncompressable binary format.
     29   UNCOMPRESSABLE = 1;
     30 
     31   // Randomly chosen from all other formats defined in this enum.
     32   RANDOM = 2;
     33 }
     34 
     35 // A block of data, to simply increase gRPC message size.
     36 message Payload {
     37   // The type of data in body.
     38   PayloadType type = 1;
     39   // Primary contents of payload.
     40   bytes body = 2;
     41 }
     42 
     43 // Unary request.
     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;
     48 
     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;
     52 
     53   // Optional input payload sent along with the request.
     54   Payload payload = 3;
     55 
     56   // Whether SimpleResponse should include username.
     57   bool fill_username = 4;
     58 
     59   // Whether SimpleResponse should include OAuth scope.
     60   bool fill_oauth_scope = 5;
     61 }
     62 
     63 // Unary response, as configured by the request.
     64 message SimpleResponse {
     65   // Payload to increase message size.
     66   Payload payload = 1;
     67   // The user the request came from, for verifying authentication was
     68   // successful when the client expected it.
     69   string username = 2;
     70   // OAuth scope.
     71   string oauth_scope = 3;
     72 }
     73 
     74 // Client-streaming request.
     75 message StreamingInputCallRequest {
     76   // Optional input payload sent along with the request.
     77   Payload payload = 1;
     78 
     79   // Not expecting any payload from the response.
     80 }
     81 
     82 // Client-streaming response.
     83 message StreamingInputCallResponse {
     84   // Aggregated size of payloads received from the client.
     85   int32 aggregated_payload_size = 1;
     86 }
     87 
     88 // Configuration for a particular response.
     89 message ResponseParameters {
     90   // Desired payload sizes in responses from the server.
     91   // If response_type is COMPRESSABLE, this denotes the size before compression.
     92   int32 size = 1;
     93 
     94   // Desired interval between consecutive responses in the response stream in
     95   // microseconds.
     96   int32 interval_us = 2;
     97 }
     98 
     99 // Server-streaming request.
    100 message StreamingOutputCallRequest {
    101   // Desired payload type in the response from the server.
    102   // If response_type is RANDOM, the payload from each response in the stream
    103   // might be of different types. This is to simulate a mixed type of payload
    104   // stream.
    105   PayloadType response_type = 1;
    106 
    107   // Configuration for each expected response message.
    108   repeated ResponseParameters response_parameters = 2;
    109 
    110   // Optional input payload sent along with the request.
    111   Payload payload = 3;
    112 }
    113 
    114 // Server-streaming response, as configured by the request and parameters.
    115 message StreamingOutputCallResponse {
    116   // Payload to increase response size.
    117   Payload payload = 1;
    118 }
    119