Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 1 | // Copyright 2016 gRPC authors. |
murgatroid99 | 44de6a1 | 2016-02-10 09:58:13 -0800 | [diff] [blame] | 2 | // |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 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 |
murgatroid99 | 44de6a1 | 2016-02-10 09:58:13 -0800 | [diff] [blame] | 6 | // |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
murgatroid99 | 44de6a1 | 2016-02-10 09:58:13 -0800 | [diff] [blame] | 8 | // |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 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. |
murgatroid99 | 44de6a1 | 2016-02-10 09:58:13 -0800 | [diff] [blame] | 14 | |
| 15 | syntax = "proto3"; |
| 16 | |
David Garcia Quintas | e5f0f95 | 2016-06-17 18:56:55 -0700 | [diff] [blame] | 17 | import "google/protobuf/timestamp.proto"; |
murgatroid99 | 44de6a1 | 2016-02-10 09:58:13 -0800 | [diff] [blame] | 18 | |
| 19 | package grpc.binary_log.v1alpha; |
| 20 | |
| 21 | enum Direction { |
David Garcia Quintas | e5f0f95 | 2016-06-17 18:56:55 -0700 | [diff] [blame] | 22 | SERVER_SEND = 0; |
| 23 | SERVER_RECV = 1; |
| 24 | CLIENT_SEND = 2; |
| 25 | CLIENT_RECV = 3; |
murgatroid99 | 44de6a1 | 2016-02-10 09:58:13 -0800 | [diff] [blame] | 26 | } |
| 27 | |
| 28 | message KeyValuePair { |
David Garcia Quintas | e5f0f95 | 2016-06-17 18:56:55 -0700 | [diff] [blame] | 29 | string key = 1; |
| 30 | string value = 2; |
murgatroid99 | 44de6a1 | 2016-02-10 09:58:13 -0800 | [diff] [blame] | 31 | } |
| 32 | |
murgatroid99 | f8c6545 | 2016-02-10 13:55:08 -0800 | [diff] [blame] | 33 | // Any sort of metadata that may be sent in either direction during a call |
murgatroid99 | 44de6a1 | 2016-02-10 09:58:13 -0800 | [diff] [blame] | 34 | message Metadata { |
murgatroid99 | f8c6545 | 2016-02-10 13:55:08 -0800 | [diff] [blame] | 35 | // Cryptographically unique identifier, generated on the client and sent |
| 36 | // to the server. |
| 37 | uint64 rpc_id = 1; |
| 38 | // Timestamp of logging the metadata |
murgatroid99 | 44de6a1 | 2016-02-10 09:58:13 -0800 | [diff] [blame] | 39 | google.protobuf.Timestamp timestamp = 2; |
| 40 | Direction direction = 3; |
murgatroid99 | f8c6545 | 2016-02-10 13:55:08 -0800 | [diff] [blame] | 41 | // The actual metadata that is being sent |
murgatroid99 | 44de6a1 | 2016-02-10 09:58:13 -0800 | [diff] [blame] | 42 | repeated KeyValuePair metadata = 4; |
| 43 | |
murgatroid99 | f8c6545 | 2016-02-10 13:55:08 -0800 | [diff] [blame] | 44 | // Initial metadata sent by the client to initiate a request |
murgatroid99 | 44de6a1 | 2016-02-10 09:58:13 -0800 | [diff] [blame] | 45 | message ClientInitialMetadata { |
murgatroid99 | f8c6545 | 2016-02-10 13:55:08 -0800 | [diff] [blame] | 46 | // The full method name that is being called |
murgatroid99 | 44de6a1 | 2016-02-10 09:58:13 -0800 | [diff] [blame] | 47 | string method_name = 1; |
murgatroid99 | f8c6545 | 2016-02-10 13:55:08 -0800 | [diff] [blame] | 48 | // The call's deadline |
| 49 | google.protobuf.Timestamp deadline = 2; |
| 50 | // The address of the connected peer |
| 51 | string peer = 3; |
murgatroid99 | 44de6a1 | 2016-02-10 09:58:13 -0800 | [diff] [blame] | 52 | } |
| 53 | |
murgatroid99 | f8c6545 | 2016-02-10 13:55:08 -0800 | [diff] [blame] | 54 | // Arbitrary key/value pairs specified by the user that are not sent over |
| 55 | // the network but are nonetheless useful to log |
murgatroid99 | 44de6a1 | 2016-02-10 09:58:13 -0800 | [diff] [blame] | 56 | message UserData { |
| 57 | } |
| 58 | |
murgatroid99 | f8c6545 | 2016-02-10 13:55:08 -0800 | [diff] [blame] | 59 | // Initial metadata response sent by the server after accepting the request |
murgatroid99 | 44de6a1 | 2016-02-10 09:58:13 -0800 | [diff] [blame] | 60 | message ServerInitialMetadata { |
| 61 | } |
| 62 | |
murgatroid99 | f8c6545 | 2016-02-10 13:55:08 -0800 | [diff] [blame] | 63 | // Status sent by the server when closing the call on the server side |
murgatroid99 | 44de6a1 | 2016-02-10 09:58:13 -0800 | [diff] [blame] | 64 | message ServerStatus { |
murgatroid99 | f8c6545 | 2016-02-10 13:55:08 -0800 | [diff] [blame] | 65 | // The status code |
murgatroid99 | 44de6a1 | 2016-02-10 09:58:13 -0800 | [diff] [blame] | 66 | uint32 code = 1; |
murgatroid99 | f8c6545 | 2016-02-10 13:55:08 -0800 | [diff] [blame] | 67 | // The status details |
murgatroid99 | 44de6a1 | 2016-02-10 09:58:13 -0800 | [diff] [blame] | 68 | string details = 2; |
| 69 | } |
| 70 | |
| 71 | oneof kind { |
| 72 | ClientInitialMetadata client_initial_metadata = 5; |
| 73 | UserData user_data = 6; |
| 74 | ServerInitialMetadata server_initial_metadata = 7; |
| 75 | ServerStatus server_status = 8; |
| 76 | } |
| 77 | } |
| 78 | |
murgatroid99 | f8c6545 | 2016-02-10 13:55:08 -0800 | [diff] [blame] | 79 | // A message that is sent during a call |
murgatroid99 | 44de6a1 | 2016-02-10 09:58:13 -0800 | [diff] [blame] | 80 | message Message { |
murgatroid99 | f8c6545 | 2016-02-10 13:55:08 -0800 | [diff] [blame] | 81 | // Cryptographically unique identifier, generated on the client and sent |
| 82 | // to the server. |
murgatroid99 | 18c4a53 | 2016-02-10 13:57:38 -0800 | [diff] [blame] | 83 | uint64 rpc_id = 1; |
murgatroid99 | f8c6545 | 2016-02-10 13:55:08 -0800 | [diff] [blame] | 84 | // The sequence number of the message. Messages sent by the client and by the |
| 85 | // server should have independently incrementing sequence numbers. |
murgatroid99 | 18c4a53 | 2016-02-10 13:57:38 -0800 | [diff] [blame] | 86 | uint32 sequence_number = 2; |
murgatroid99 | 44de6a1 | 2016-02-10 09:58:13 -0800 | [diff] [blame] | 87 | Direction direction = 3; |
murgatroid99 | f8c6545 | 2016-02-10 13:55:08 -0800 | [diff] [blame] | 88 | // The length of the complete message. |
| 89 | uint32 length = 4; |
| 90 | // The contents of the message. May be a prefix instead of the complete |
| 91 | // message. |
| 92 | bytes data = 5; |
Deepak Lukose | dba4c5f | 2016-03-25 12:54:25 -0700 | [diff] [blame] | 93 | } |