blob: 77100ebbef9e435ff4b25191c94be49cd7b570e4 [file] [log] [blame]
Jan Tattermusch7897ae92017-06-07 22:57:36 +02001// Copyright 2016 gRPC authors.
murgatroid9944de6a12016-02-10 09:58:13 -08002//
Jan Tattermusch7897ae92017-06-07 22:57:36 +02003// 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
murgatroid9944de6a12016-02-10 09:58:13 -08006//
Jan Tattermusch7897ae92017-06-07 22:57:36 +02007// http://www.apache.org/licenses/LICENSE-2.0
murgatroid9944de6a12016-02-10 09:58:13 -08008//
Jan Tattermusch7897ae92017-06-07 22:57:36 +02009// 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.
murgatroid9944de6a12016-02-10 09:58:13 -080014
15syntax = "proto3";
16
David Garcia Quintase5f0f952016-06-17 18:56:55 -070017import "google/protobuf/timestamp.proto";
murgatroid9944de6a12016-02-10 09:58:13 -080018
19package grpc.binary_log.v1alpha;
20
21enum Direction {
David Garcia Quintase5f0f952016-06-17 18:56:55 -070022 SERVER_SEND = 0;
23 SERVER_RECV = 1;
24 CLIENT_SEND = 2;
25 CLIENT_RECV = 3;
murgatroid9944de6a12016-02-10 09:58:13 -080026}
27
28message KeyValuePair {
David Garcia Quintase5f0f952016-06-17 18:56:55 -070029 string key = 1;
30 string value = 2;
murgatroid9944de6a12016-02-10 09:58:13 -080031}
32
murgatroid99f8c65452016-02-10 13:55:08 -080033// Any sort of metadata that may be sent in either direction during a call
murgatroid9944de6a12016-02-10 09:58:13 -080034message Metadata {
murgatroid99f8c65452016-02-10 13:55:08 -080035 // Cryptographically unique identifier, generated on the client and sent
36 // to the server.
37 uint64 rpc_id = 1;
38 // Timestamp of logging the metadata
murgatroid9944de6a12016-02-10 09:58:13 -080039 google.protobuf.Timestamp timestamp = 2;
40 Direction direction = 3;
murgatroid99f8c65452016-02-10 13:55:08 -080041 // The actual metadata that is being sent
murgatroid9944de6a12016-02-10 09:58:13 -080042 repeated KeyValuePair metadata = 4;
43
murgatroid99f8c65452016-02-10 13:55:08 -080044 // Initial metadata sent by the client to initiate a request
murgatroid9944de6a12016-02-10 09:58:13 -080045 message ClientInitialMetadata {
murgatroid99f8c65452016-02-10 13:55:08 -080046 // The full method name that is being called
murgatroid9944de6a12016-02-10 09:58:13 -080047 string method_name = 1;
murgatroid99f8c65452016-02-10 13:55:08 -080048 // The call's deadline
49 google.protobuf.Timestamp deadline = 2;
50 // The address of the connected peer
51 string peer = 3;
murgatroid9944de6a12016-02-10 09:58:13 -080052 }
53
murgatroid99f8c65452016-02-10 13:55:08 -080054 // Arbitrary key/value pairs specified by the user that are not sent over
55 // the network but are nonetheless useful to log
murgatroid9944de6a12016-02-10 09:58:13 -080056 message UserData {
57 }
58
murgatroid99f8c65452016-02-10 13:55:08 -080059 // Initial metadata response sent by the server after accepting the request
murgatroid9944de6a12016-02-10 09:58:13 -080060 message ServerInitialMetadata {
61 }
62
murgatroid99f8c65452016-02-10 13:55:08 -080063 // Status sent by the server when closing the call on the server side
murgatroid9944de6a12016-02-10 09:58:13 -080064 message ServerStatus {
murgatroid99f8c65452016-02-10 13:55:08 -080065 // The status code
murgatroid9944de6a12016-02-10 09:58:13 -080066 uint32 code = 1;
murgatroid99f8c65452016-02-10 13:55:08 -080067 // The status details
murgatroid9944de6a12016-02-10 09:58:13 -080068 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
murgatroid99f8c65452016-02-10 13:55:08 -080079// A message that is sent during a call
murgatroid9944de6a12016-02-10 09:58:13 -080080message Message {
murgatroid99f8c65452016-02-10 13:55:08 -080081 // Cryptographically unique identifier, generated on the client and sent
82 // to the server.
murgatroid9918c4a532016-02-10 13:57:38 -080083 uint64 rpc_id = 1;
murgatroid99f8c65452016-02-10 13:55:08 -080084 // The sequence number of the message. Messages sent by the client and by the
85 // server should have independently incrementing sequence numbers.
murgatroid9918c4a532016-02-10 13:57:38 -080086 uint32 sequence_number = 2;
murgatroid9944de6a12016-02-10 09:58:13 -080087 Direction direction = 3;
murgatroid99f8c65452016-02-10 13:55:08 -080088 // 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 Lukosedba4c5f2016-03-25 12:54:25 -070093}