github.com/ronaksoft/rony@v0.16.26-0.20230807065236-1743dbfe6959/options.proto (about)

     1  syntax = "proto2";
     2  import "google/protobuf/descriptor.proto";
     3  option go_package = "github.com/ronaksoft/rony";
     4  
     5  // RestOpt is the container message for all the required and optional parameters for REST setup.
     6  // By adding 'rony_rest' option to the method definition a REST wrapper will be generated for that
     7  // method and that RPC handler will become accessible using REST endpoint.
     8  message RestOpt {
     9    // method identifies the HTTP command: i.e. 'get', 'post', 'put', ...
    10    required string method = 1;
    11    // path identifies the path that this RPC method will be available as REST endpoint.
    12    required string path = 2;
    13    // bind_path_variables is a list of pair of bindings. For example if we have a path '/part1/:var1/:var2'
    14    // and we want to bind 'var1' to field 'fieldVar1': "var1=fieldVar1"
    15    repeated string bind_path_param = 3;
    16    // bind_query_param is a list of pair of bindings. For example if we have a query param var1
    17    // and we want to bind 'var1' to field 'fieldVar1': "var1=fieldVar1"
    18    repeated string bind_query_param = 4;
    19    // json_encode if is set then input and output data are json encoded version of the proto messages
    20    optional bool json_encode = 5;
    21  }
    22  
    23  // ModelOpt holds all the information if you want to create a model from your proto message.
    24  message ModelOpt {
    25    // singleton marks this model as a singleton.
    26    optional bool singleton = 1;
    27    // global_datasource generates the code for remote repository
    28    // POSSIBLE VALUES: cql, sql
    29    optional string global_datasource = 2;
    30    // local_datasource generates the code for local repository
    31    // POSSIBLE VALUES: store, cql, sql
    32    optional string local_datasource = 3;
    33    // table a virtual table presentation to hold instances of this message, like rows in a table
    34    // PRIMARY KEY FORMAT: ( (partitionKey1, partitionKey2, ...), clusteringKey1, clusteringKey2, ...)
    35    optional PrimaryKeyOpt table = 4;
    36    // view creates a materialized view of the aggregate based on the primary key.
    37    // PRIMARY KEY FORMAT: ( (partitionKey1, partitionKey2, ...), clusteringKey1, clusteringKey2, ...)
    38    // NOTE: The primary key of the view must contains all the primary key items of the table. They don't need to
    39    //           follow the same order as table. for example the following is correct:
    40    //                  table = ((a, b), c)
    41    //                  view = ((c, a),  d, b)
    42    repeated PrimaryKeyOpt view = 5;
    43  
    44  }
    45  
    46  // PrimaryKeyOpt is the container for aggregate primary key settings. It is going to replace old
    47  // rony_aggregate_table & rony_aggregate_view options.
    48  message PrimaryKeyOpt {
    49    repeated string part_key = 1;
    50    repeated string sort_key = 2;
    51    // Alias could be used to override the name of materialized view. If this is not set, Rony automatically
    52    // generates for you.
    53    optional string alias = 4;
    54  }
    55  
    56  message CliOpt {
    57    // protocol defines what protocol should client use to communicate with server.
    58    // POSSIBLE VALUES: "ws", "http"
    59    optional string protocol = 1;
    60  }
    61  
    62  extend google.protobuf.ServiceOptions {
    63    // rony_cli generates the boiler plate code for client stub of rpc methods.
    64    optional CliOpt rony_cli = 50001;
    65    // rony_no_client if is set then no client code will be generated. This flag is for internal usage.
    66    // DO NOT USE IT.
    67    optional bool rony_no_client = 50003;
    68  }
    69  
    70  extend google.protobuf.MethodOptions {
    71    // rony_internal marks this method internal, hence only edges could execute this rpc through tunnel messages. In other words,
    72    // this command is not exposed to external clients connected through th gateway.
    73    optional bool rony_internal = 50002;
    74    optional RestOpt rony_rest = 50003;
    75  }
    76  
    77  extend google.protobuf.MessageOptions {
    78    optional ModelOpt rony_model = 50001;
    79    optional bool rony_envelope = 50031;
    80    // rony_skip_json will not generate de/serializer for JSON. If you use this option, then you need to
    81    // write them manually otherwise you will get compiler error.
    82    optional bool rony_skip_json = 50032;
    83  }
    84  
    85  extend google.protobuf.FieldOptions {
    86    // rony_index marks this field as an indexed field. Some queries will be generated for this indexed field.
    87    optional bool rony_index = 50001;
    88    // rony_default set the help text in generated cli client. This flag only works if rony_cobra_cmd is set
    89    // in the service.
    90    optional string rony_help = 50002;
    91    // rony_default set the default value in generated cli client. This flag only works if rony_cobra_cmd is set
    92    // in the service.
    93    optional string rony_default = 50003;
    94  }