-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcoprocess_object.proto
69 lines (59 loc) · 2.12 KB
/
coprocess_object.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
syntax = "proto3";
import "coprocess_mini_request_object.proto";
import "coprocess_response_object.proto";
import "coprocess_session_state.proto";
import "coprocess_common.proto";
package coprocess;
option go_package = "/coprocess";
/**
* @hidecollaborationgraph
* @brief Main entry point
*
* Wraps a MiniRequestObject and contains additional fields that are useful for users that implement their own request dispatchers, like the middleware hook type and name
*/
message Object {
HookType hook_type = 1; /**< The plugin hook type */
string hook_name = 2; /**< The plugin name */
MiniRequestObject request = 3; /**< The main request data structure used by rich plugins\. It’s used for middleware calls and contains important fields like headers, parameters, body and URL */
SessionState session = 4; /**< Stores information about the current key/user
that’s used for authentication */
map<string, string> metadata = 5; /**< Contains the metadata. This is a
dynamic field */
map<string, string> spec = 6; /**< Contains information about API definition,
including APIID, OrgID and config_data */
ResponseObject response = 7; /**< The ResponseObject is used by response hooks,
the fields are populated with the upstream HTTP
response data. All the field contents can be
modified */
}
/**
* @hidecollaborationgraph
* @brief The JSON payload of an event
*
* An event is represented as a JSON payload
*/
message Event {
/** The JSON payload */
string payload = 1;
}
/**
* @hidecollaborationgraph
* @brief Why does EventReply have no fields defined?
*/
message EventReply {
}
/**
* @brief GRPC server interface
*
* The server interface that must be implemented by the target language
*/
service Dispatcher {
/**
* @brief Accepts and returns an \ref Object
*/
rpc Dispatch (Object) returns (Object) {}
/**
* @brief Dispatches an event to the target language
*/
rpc DispatchEvent (Event) returns (EventReply) {}
}