This repository has been archived by the owner on Mar 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
riff-rpc.proto
73 lines (56 loc) · 1.99 KB
/
riff-rpc.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
// This protobuf definition defines how riff encodes messages on the wire when doing an RPC function invocation.
syntax = "proto3";
option java_multiple_files = true;
option java_package = "io.projectriff.invoker.rpc";
option java_outer_classname = "Invoker";
option go_package = "rpc";
package streaming;
service Riff {
rpc Invoke (stream InputSignal) returns (stream OutputSignal) {}
}
// Represents data flowing in when invoking a riff function. A special StartFrame is sent first to specify metadata
// about the invocation
message InputSignal {
oneof frame {
StartFrame start = 1;
InputFrame data = 2;
}
}
// Contains setup data for an invocation
message StartFrame {
// The ContentTypes that an invocation is allowed to produce for each output parameter
repeated string expectedContentTypes = 1;
// The logical names for input arguments
repeated string inputNames = 2;
// The logical names for output arguments
repeated string outputNames = 3;
}
// Contains actual invocation data, as input events.
message InputFrame {
// The actual content of the event.
bytes payload = 1;
// How to interpret the bytes that make up the payload of this frame.
string contentType = 2;
// Additional custom headers.
map<string, string> headers = 3;
// The input argument index this frame pertains to.
int32 argIndex = 4;
}
// Represents data flowing out when invoking a riff function. Represented as a oneof with a single case to allow for
// future extensions
message OutputSignal {
oneof frame {
OutputFrame data = 1;
}
}
// Contains actual function invocation result data, as output events.
message OutputFrame {
// The actual content of the event.
bytes payload = 1;
// How to interpret the bytes that make up the payload of this frame.
string contentType = 2;
// Additional custom headers.
map<string, string> headers = 3;
// The index of the result this frame pertains to.
int32 resultIndex = 4;
}