-
Notifications
You must be signed in to change notification settings - Fork 127
/
ServerSideExtension.proto
146 lines (127 loc) · 5 KB
/
ServerSideExtension.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
syntax="proto3";
/**
* A gRPC definition for the Qlik engine extension protocol.
*/
package qlik.sse;
/**
* Enable protobuf arena allocations in C++.
* Using an arena can boost performance by reducing the overhead for heap allocations.
*/
option cc_enable_arenas = true;
/**
* Data types of the parameters and return values.
*/
enum DataType {
STRING = 0; /// Contains only string.
NUMERIC = 1; /// Contains only double.
DUAL = 2; /// Contains both a string and a double.
}
/**
* Types of functions (determined by their return values).
*/
enum FunctionType {
SCALAR = 0; /// The return value is a scalar per row.
AGGREGATION = 1; /// All rows are aggregated into a single scalar.
TENSOR = 2; /// Multiple rows in, multiple rows out.
}
/**
* An empty message used when nothing is to be passed in a call.
*/
message Empty {}
/**
* Parameter definition for functions and script calls.
*/
message Parameter {
DataType dataType = 1; /// The data type of the parameter.
string name = 2; /// The name of the parameter.
}
/**
* Field definition for function and script calls.
*/
message FieldDescription {
DataType dataType = 1; /// The data type of the field.
string name = 2; /// The name of the field.
repeated string tags = 3; /// The tags of the field.
}
/**
* The definition of a function, which informs the Qlik engine how to use it.
*/
message FunctionDefinition {
string name = 1; /// The name of the function.
FunctionType functionType = 2; /// The type of the function.
DataType returnType = 3; /// The return type of the function.
repeated Parameter params = 4; /// The parameters the function takes.
int32 functionId = 5; /// A unique ID number for the function, set by the plugin, to be used in calls from the Qlik engine to the plugin.
}
/**
* A full description of the plugin, sent to the Qlik engine, listing all functions available and indicating whether script evaluation is allowed.
*/
message Capabilities {
bool allowScript = 1; /// When true, the Qlik engine allows scripts to be sent to the plugin.
repeated FunctionDefinition functions = 2; /// The definitions of all available functions.
string pluginIdentifier = 3; /// The ID or name of the plugin.
string pluginVersion = 4; /// The version of the plugin.
}
/**
* The basic data type for the data stream. Can contain double, string, or both.
*/
message Dual {
double numData = 1; /// Numeric value as double.
string strData = 2; /// String.
}
/**
* A row of duals.
*/
message Row {
repeated Dual duals = 1; /// Row of duals.
}
/**
* A number of rows collected in one message. The actual number will depend on the size of each row and is adjusted to optimize throughput.
*/
message BundledRows {
repeated Row rows = 1;
}
/**
* A header sent at the start of an EvaluateScript request under the key "qlik-scriptrequestheader-bin".
*/
message ScriptRequestHeader {
string script = 1; /// The script to be executed.
FunctionType functionType = 2; /// The function type of the script evaluation: scalar, aggregation or tensor.
DataType returnType = 3; /// The return type from the script evaluation: numeric, string or both.
repeated Parameter params = 4; /// The parameters names and types passed to the script.
}
/**
* A header sent at the start of an ExecuteFunction request under the key "qlik-functionrequestheader-bin".
*/
message FunctionRequestHeader {
int32 functionId = 1; /// The ID of the function to be executed.
string version = 2; /// A dummy variable as a workaround for an issue.
}
/**
* A header sent at the start of both an EvaluateScript request and an ExecuteFunction request under the key "qlik-commonrequestheader-bin".
*/
message CommonRequestHeader {
string appId = 1; /// The ID of the app the request was executed in.
string userId = 2; /// The ID of the user the request was executed by.
int64 cardinality = 3; /// The cardinality of the parameters.
}
/**
* A header sent before returning data to Qlik, under the key "qlik-tabledescription-bin".
*/
message TableDescription {
repeated FieldDescription fields = 1; /// The fields of the table.
string name = 2; /// The name of the table.
int64 numberOfRows = 3; /// Number of rows in table.
}
/**
* The communication service provided between the Qlik engine and the plugin.
*/
service Connector
{
/// A handshake call for the Qlik engine to retrieve the capability of the plugin.
rpc GetCapabilities (Empty) returns (Capabilities) {}
/// Requests a function to be executed as specified in the header.
rpc ExecuteFunction (stream BundledRows) returns (stream BundledRows) {}
/// Requests a script to be evaluated as specified in the header.
rpc EvaluateScript (stream BundledRows) returns (stream BundledRows) {}
}