1// Copyright 2017 Google LLC
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
15syntax = "proto3";
16
17package rpcreplay;
18
19import "google/protobuf/any.proto";
20
21// An Entry represents a single RPC activity, typically a request or response.
22message Entry {
23  enum Kind {
24    TYPE_UNSPECIFIED = 0;
25
26    // A unary request.
27    // method: the full name of the method
28    // message: the request proto
29    // is_error: false
30    // ref_index: 0
31    REQUEST = 1;
32
33    // A unary response.
34    // method: the full name of the method
35    // message:
36    //   if is_error: a google.rpc.Status proto
37    //   else:        the response proto
38    // ref_index: index in the sequence of Entries of matching request (1-based)
39    RESPONSE = 2;
40
41    // A method that creates a stream.
42    // method: the full name of the method
43    // message:
44    //   if is_error: a google.rpc.Status proto
45    //   else:        nil
46    // ref_index: 0
47    CREATE_STREAM = 3;
48
49    // A call to Send on the client returned by a stream-creating method.
50    // method: unset
51    // message: the proto being sent
52    // is_error: false
53    // ref_index: index of matching CREATE_STREAM entry (1-based)
54    SEND = 4;   // message sent on stream
55
56    // A call to Recv on the client returned by a stream-creating method.
57    // method: unset
58    // message:
59    //   if is_error: a google.rpc.Status proto, or nil on EOF
60    //   else:        the received message
61    // ref_index: index of matching CREATE_STREAM entry
62    RECV = 5;   // message received from stream
63  }
64
65  Kind kind = 1;
66  string method = 2;                // method name
67  google.protobuf.Any message = 3;  // request, response or error status
68  bool is_error = 4;                // was response an error?
69  int32 ref_index = 5;              // for RESPONSE, index of matching request;
70                                    // for SEND/RECV, index of CREATE_STREAM
71}
72