github.com/ronaksoft/rony@v0.16.26-0.20230807065236-1743dbfe6959/cmd/rony/skel/proto/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  // PrimaryKeyOpt is the container for aggregate primary key settings. It is going to replace old
    24  // rony_aggregate_table & rony_aggregate_view options.
    25  message PrimaryKeyOpt {
    26    repeated string part_key = 1;
    27    repeated string sort_key = 2;
    28    // Alias could be used to override the name of materialized view. If this is not set, Rony automatically
    29    // generates for you.
    30    optional string alias = 4;
    31  }
    32  
    33  extend google.protobuf.ServiceOptions {
    34    // rony_cobra_cmd generates the boiler plate code for client stub of rpc methods, using cobra package.
    35    optional bool rony_cobra_cmd = 50001;
    36    // rony_cobra_cmd_protocol defines what protocol should client use to communicate with server.
    37    // POSSIBLE VALUES: "ws", "http"
    38    optional string rony_cobra_cmd_protocol = 50002;
    39    // rony_no_client if is set then no client code will be generated. This flag is for internal usage.
    40    // DO NOT USE IT.
    41    optional bool rony_no_client = 50003;
    42  }
    43  
    44  extend google.protobuf.MethodOptions {
    45    // rony_internal marks this method internal, hence only edges could execute this rpc through tunnel messages. In other words,
    46    // this command is not exposed to external clients connected through th gateway.
    47    optional bool rony_internal = 50002;
    48    optional RestOpt rony_rest = 50003;
    49  }
    50  
    51  extend google.protobuf.MessageOptions {
    52    // rony_local_repo generates the code for local repository
    53    // POSSIBLE VALUES: store, cql, sql
    54    optional string rony_local_repo = 50001;
    55    // rony_global_repo generates the code for remote repository
    56    // POSSIBLE VALUES: store, cql, sql
    57    optional string rony_global_repo = 50002;
    58    // rony_singleton marks this message as a singleton.
    59    // NOTE: a message could either have 'rony_aggregate' ro 'rony_singleton' options at a same time. Setting both
    60    // cause unpredictable results.
    61    optional bool rony_singleton = 50003;
    62    // rony_table creates a virtual table presentation to hold instances of this message, like rows in a table
    63    // PRIMARY KEY FORMAT: ( (partitionKey1, partitionKey2, ...), clusteringKey1, clusteringKey2, ...)
    64    optional PrimaryKeyOpt rony_table = 50024;
    65    // rony_view creates a materialized view of the aggregate based on the primary key.
    66    // PRIMARY KEY FORMAT: ( (partitionKey1, partitionKey2, ...), clusteringKey1, clusteringKey2, ...)
    67    // NOTE: The primary key of the view must contains all the primary key items of the table. They don't need to
    68    //           follow the same order as table. for example the following is correct:
    69    //                  rony_aggregate_table = ((a, b), c)
    70    //                  rony_aggregate_view = ((c, a),  d, b)
    71    repeated PrimaryKeyOpt rony_view = 50025;
    72  }
    73  
    74  extend google.protobuf.FieldOptions {
    75    // rony_index marks this field as an indexed field. Some queries will be generated for this indexed field.
    76    optional bool rony_index = 50001;
    77    // rony_default set the help text in generated cli client. This flag only works if rony_cobra_cmd is set
    78    // in the service.
    79    optional string rony_help = 50002;
    80    // rony_default set the default value in generated cli client. This flag only works if rony_cobra_cmd is set
    81    // in the service.
    82    optional string rony_default = 50003;
    83  }