-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharpc_protocol.proto
90 lines (72 loc) · 1.76 KB
/
arpc_protocol.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
// Copyright (c) 2017 Nuxi (https://nuxi.nl/) and contributors.
//
// SPDX-License-Identifier: BSD-2-Clause
syntax = 'proto3';
package arpc_protocol;
import "google/protobuf/any.proto";
// The ARPC wire format.
enum StatusCode {
// Place UNKNOWN at index zero, so that any errors added in the future
// will automatically get mapped to it.
UNKNOWN = 0;
ABORTED = 1;
ALREADY_EXISTS = 2;
CANCELLED = 3;
DATA_LOSS = 4;
DEADLINE_EXCEEDED = 5;
FAILED_PRECONDITION = 6;
INTERNAL = 7;
INVALID_ARGUMENT = 8;
NOT_FOUND = 9;
OK = 10;
OUT_OF_RANGE = 11;
PERMISSION_DENIED = 12;
RESOURCE_EXHAUSTED = 13;
UNAUTHENTICATED = 14;
UNAVAILABLE = 15;
UNIMPLEMENTED = 16;
}
message Status {
StatusCode code = 1;
string message = 2;
}
// Messages sent from clients to servers.
message RpcMethod {
string service = 1;
string rpc = 2;
}
message UnaryRequest {
RpcMethod rpc_method = 1;
google.protobuf.Any request = 2;
bool server_streaming = 3;
}
message StreamingRequestStart {
RpcMethod rpc_method = 1;
}
message StreamingRequestData {
google.protobuf.Any request = 1;
}
message StreamingRequestFinish {
}
message ClientMessage {
UnaryRequest unary_request = 1;
StreamingRequestStart streaming_request_start = 2;
StreamingRequestData streaming_request_data = 3;
StreamingRequestFinish streaming_request_finish = 4;
}
// Messages sent from servers to clients.
message UnaryResponse {
Status status = 1;
google.protobuf.Any response = 2;
}
message StreamingResponseData {
google.protobuf.Any response = 1;
}
message StreamingResponseFinish {
Status status = 1;
}
message ServerMessage {
UnaryResponse unary_response = 1;
StreamingResponseData streaming_response_data = 2;
StreamingResponseFinish streaming_response_finish = 3;
}