This repository has been archived by the owner on Nov 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathoptions.proto
94 lines (85 loc) · 4.35 KB
/
options.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
syntax = "proto2";
import "google/protobuf/descriptor.proto";
option go_package = "github.com/ronaksoft/rony";
// RestOpt is the container message for all the required and optional parameters for REST setup.
// By adding 'rony_rest' option to the method definition a REST wrapper will be generated for that
// method and that RPC handler will become accessible using REST endpoint.
message RestOpt {
// method identifies the HTTP command: i.e. 'get', 'post', 'put', ...
required string method = 1;
// path identifies the path that this RPC method will be available as REST endpoint.
required string path = 2;
// bind_path_variables is a list of pair of bindings. For example if we have a path '/part1/:var1/:var2'
// and we want to bind 'var1' to field 'fieldVar1': "var1=fieldVar1"
repeated string bind_path_param = 3;
// bind_query_param is a list of pair of bindings. For example if we have a query param var1
// and we want to bind 'var1' to field 'fieldVar1': "var1=fieldVar1"
repeated string bind_query_param = 4;
// json_encode if is set then input and output data are json encoded version of the proto messages
optional bool json_encode = 5;
}
// ModelOpt holds all the information if you want to create a model from your proto message.
message ModelOpt {
// singleton marks this model as a singleton.
optional bool singleton = 1;
// global_datasource generates the code for remote repository
// POSSIBLE VALUES: cql, sql
optional string global_datasource = 2;
// local_datasource generates the code for local repository
// POSSIBLE VALUES: store, cql, sql
optional string local_datasource = 3;
// table a virtual table presentation to hold instances of this message, like rows in a table
// PRIMARY KEY FORMAT: ( (partitionKey1, partitionKey2, ...), clusteringKey1, clusteringKey2, ...)
optional PrimaryKeyOpt table = 4;
// view creates a materialized view of the aggregate based on the primary key.
// PRIMARY KEY FORMAT: ( (partitionKey1, partitionKey2, ...), clusteringKey1, clusteringKey2, ...)
// NOTE: The primary key of the view must contains all the primary key items of the table. They don't need to
// follow the same order as table. for example the following is correct:
// table = ((a, b), c)
// view = ((c, a), d, b)
repeated PrimaryKeyOpt view = 5;
}
// PrimaryKeyOpt is the container for aggregate primary key settings. It is going to replace old
// rony_aggregate_table & rony_aggregate_view options.
message PrimaryKeyOpt {
repeated string part_key = 1;
repeated string sort_key = 2;
// Alias could be used to override the name of materialized view. If this is not set, Rony automatically
// generates for you.
optional string alias = 4;
}
message CliOpt {
// protocol defines what protocol should client use to communicate with server.
// POSSIBLE VALUES: "ws", "http"
optional string protocol = 1;
}
extend google.protobuf.ServiceOptions {
// rony_cli generates the boiler plate code for client stub of rpc methods.
optional CliOpt rony_cli = 50001;
// rony_no_client if is set then no client code will be generated. This flag is for internal usage.
// DO NOT USE IT.
optional bool rony_no_client = 50003;
}
extend google.protobuf.MethodOptions {
// rony_internal marks this method internal, hence only edges could execute this rpc through tunnel messages. In other words,
// this command is not exposed to external clients connected through th gateway.
optional bool rony_internal = 50002;
optional RestOpt rony_rest = 50003;
}
extend google.protobuf.MessageOptions {
optional ModelOpt rony_model = 50001;
optional bool rony_envelope = 50031;
// rony_skip_json will not generate de/serializer for JSON. If you use this option, then you need to
// write them manually otherwise you will get compiler error.
optional bool rony_skip_json = 50032;
}
extend google.protobuf.FieldOptions {
// rony_index marks this field as an indexed field. Some queries will be generated for this indexed field.
optional bool rony_index = 50001;
// rony_default set the help text in generated cli client. This flag only works if rony_cobra_cmd is set
// in the service.
optional string rony_help = 50002;
// rony_default set the default value in generated cli client. This flag only works if rony_cobra_cmd is set
// in the service.
optional string rony_default = 50003;
}