OSDN Git Service

new repo
[bytom/vapor.git] / vendor / google.golang.org / grpc / benchmark / grpc_testing / messages.proto
1 // Copyright 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
17 syntax = "proto3";
18
19 package grpc.testing;
20
21 // The type of payload that should be returned.
22 enum PayloadType {
23   // Compressable text format.
24   COMPRESSABLE = 0;
25
26   // Uncompressable binary format.
27   UNCOMPRESSABLE = 1;
28
29   // Randomly chosen from all other formats defined in this enum.
30   RANDOM = 2;
31 }
32
33 // Compression algorithms
34 enum CompressionType {
35   // No compression
36   NONE = 0;
37   GZIP = 1;
38   DEFLATE = 2;
39 }
40
41 // A block of data, to simply increase gRPC message size.
42 message Payload {
43   // The type of data in body.
44   PayloadType type = 1;
45   // Primary contents of payload.
46   bytes body = 2;
47 }
48
49 // A protobuf representation for grpc status. This is used by test
50 // clients to specify a status that the server should attempt to return.
51 message EchoStatus {
52   int32 code = 1;
53   string message = 2;
54 }
55
56 // Unary request.
57 message SimpleRequest {
58   // Desired payload type in the response from the server.
59   // If response_type is RANDOM, server randomly chooses one from other formats.
60   PayloadType response_type = 1;
61
62   // Desired payload size in the response from the server.
63   // If response_type is COMPRESSABLE, this denotes the size before compression.
64   int32 response_size = 2;
65
66   // Optional input payload sent along with the request.
67   Payload payload = 3;
68
69   // Whether SimpleResponse should include username.
70   bool fill_username = 4;
71
72   // Whether SimpleResponse should include OAuth scope.
73   bool fill_oauth_scope = 5;
74
75   // Compression algorithm to be used by the server for the response (stream)
76   CompressionType response_compression = 6;
77
78   // Whether server should return a given status
79   EchoStatus response_status = 7;
80 }
81
82 // Unary response, as configured by the request.
83 message SimpleResponse {
84   // Payload to increase message size.
85   Payload payload = 1;
86   // The user the request came from, for verifying authentication was
87   // successful when the client expected it.
88   string username = 2;
89   // OAuth scope.
90   string oauth_scope = 3;
91 }
92
93 // Client-streaming request.
94 message StreamingInputCallRequest {
95   // Optional input payload sent along with the request.
96   Payload payload = 1;
97
98   // Not expecting any payload from the response.
99 }
100
101 // Client-streaming response.
102 message StreamingInputCallResponse {
103   // Aggregated size of payloads received from the client.
104   int32 aggregated_payload_size = 1;
105 }
106
107 // Configuration for a particular response.
108 message ResponseParameters {
109   // Desired payload sizes in responses from the server.
110   // If response_type is COMPRESSABLE, this denotes the size before compression.
111   int32 size = 1;
112
113   // Desired interval between consecutive responses in the response stream in
114   // microseconds.
115   int32 interval_us = 2;
116 }
117
118 // Server-streaming request.
119 message StreamingOutputCallRequest {
120   // Desired payload type in the response from the server.
121   // If response_type is RANDOM, the payload from each response in the stream
122   // might be of different types. This is to simulate a mixed type of payload
123   // stream.
124   PayloadType response_type = 1;
125
126   // Configuration for each expected response message.
127   repeated ResponseParameters response_parameters = 2;
128
129   // Optional input payload sent along with the request.
130   Payload payload = 3;
131
132   // Compression algorithm to be used by the server for the response (stream)
133   CompressionType response_compression = 6;
134
135   // Whether server should return a given status
136   EchoStatus response_status = 7;
137 }
138
139 // Server-streaming response, as configured by the request and parameters.
140 message StreamingOutputCallResponse {
141   // Payload to increase response size.
142   Payload payload = 1;
143 }
144
145 // For reconnect interop test only.
146 // Client tells server what reconnection parameters it used.
147 message ReconnectParams {
148   int32 max_reconnect_backoff_ms = 1;
149 }
150
151 // For reconnect interop test only.
152 // Server tells client whether its reconnects are following the spec and the
153 // reconnect backoffs it saw.
154 message ReconnectInfo {
155   bool passed = 1;
156   repeated int32 backoff_ms = 2;
157 }