Forráskód Böngészése

fix: labels and descriptions

Kjell Winblad 1 éve
szülő
commit
5e442fcbca

+ 24 - 6
apps/emqx_bridge_hstreamdb/src/emqx_bridge_hstreamdb.erl

@@ -1,4 +1,4 @@
-%%--------------------------------------------------------------------
+%--------------------------------------------------------------------
 %% Copyright (c) 2022-2023 EMQ Technologies Co., Ltd. All Rights Reserved.
 %%--------------------------------------------------------------------
 -module(emqx_bridge_hstreamdb).
@@ -160,9 +160,15 @@ fields(hstreamdb_action) ->
     );
 fields(action_parameters) ->
     [
-        {stream, mk(binary(), #{required => true, desc => ?DESC("stream_name")})},
+        {stream,
+            mk(binary(), #{
+                required => true, desc => ?DESC(emqx_bridge_hstreamdb_connector, "stream_name")
+            })},
 
-        {partition_key, mk(binary(), #{required => false, desc => ?DESC("partition_key")})},
+        {partition_key,
+            mk(binary(), #{
+                required => false, desc => ?DESC(emqx_bridge_hstreamdb_connector, "partition_key")
+            })},
 
         {grpc_flush_timeout, fun grpc_flush_timeout/1},
         {record_template,
@@ -181,7 +187,9 @@ fields(connector_fields) ->
     [
         {url,
             mk(binary(), #{
-                required => true, desc => ?DESC("url"), default => <<"http://127.0.0.1:6570">>
+                required => true,
+                desc => ?DESC(emqx_bridge_hstreamdb_connector, "url"),
+                default => <<"http://127.0.0.1:6570">>
             })},
         {grpc_timeout, fun grpc_timeout/1}
     ] ++ emqx_connector_schema_lib:ssl_fields();
@@ -208,13 +216,13 @@ fields("put") ->
         connector_fields().
 
 grpc_timeout(type) -> emqx_schema:timeout_duration_ms();
-grpc_timeout(desc) -> ?DESC("grpc_timeout");
+grpc_timeout(desc) -> ?DESC(emqx_bridge_hstreamdb_connector, "grpc_timeout");
 grpc_timeout(default) -> ?DEFAULT_GRPC_TIMEOUT_RAW;
 grpc_timeout(required) -> false;
 grpc_timeout(_) -> undefined.
 
 grpc_flush_timeout(type) -> emqx_schema:timeout_duration_ms();
-grpc_flush_timeout(desc) -> ?DESC("grpc_timeout");
+grpc_flush_timeout(desc) -> ?DESC("grpc_flush_timeout");
 grpc_flush_timeout(default) -> ?DEFAULT_GRPC_FLUSH_TIMEOUT_RAW;
 grpc_flush_timeout(required) -> false;
 grpc_flush_timeout(_) -> undefined.
@@ -236,6 +244,16 @@ desc("config") ->
     ?DESC("desc_config");
 desc(Method) when Method =:= "get"; Method =:= "put"; Method =:= "post" ->
     ["Configuration for HStreamDB bridge using `", string:to_upper(Method), "` method."];
+desc("creation_opts") ->
+    ?DESC(emqx_resource_schema, "creation_opts");
+desc("config_connector") ->
+    ?DESC("config_connector");
+desc(hstreamdb_action) ->
+    ?DESC("hstreamdb_action");
+desc(action_parameters) ->
+    ?DESC("action_parameters");
+desc(connector_resource_opts) ->
+    ?DESC(emqx_resource_schema, "resource_opts");
 desc(_) ->
     undefined.
 

+ 54 - 0
rel/i18n/emqx_bridge_hstreamdb.hocon

@@ -47,4 +47,58 @@ NOTE: When you use `raw record` template (which means the data is not a valid JS
 record_template.label:
 """HStream Record"""
 
+action_parameters.desc:
+"""Action specific configuration."""
+
+action_parameters.label:
+"""Action"""
+
+grpc_flush_timeout.desc:
+"""Period for flushing gRPC calls to the HStreamDB server"""
+
+grpc_flush_timeout.label:
+"""gRPC Flush Period"""
+
+aggregation_pool_size.desc:
+"""Size of Record Aggregation Pool"""
+
+aggregation_pool_size.label:
+"""Aggregation Pool Size"""
+
+max_batches.desc:
+"""Maximum number of unconfirmed batches in the flush queue"""
+
+max_batches.label:
+"""Max Batches"""
+
+writer_pool_size.desc:
+"""Writer Pool Size"""
+
+writer_pool_size.label:
+"""Writer Pool Size"""
+
+batch_size.desc:
+"""Maximum number of insert data clauses that can be sent in a single request"""
+
+batch_size.label:
+"""Max Batch Append Count"""
+
+batch_interval.desc:
+"""Maximum interval in milliseconds that is allowed between two successive (batch) request"""
+
+batch_interval.label:
+"""Max Batch Interval"""
+
+hstreamdb_action.desc:
+"""Configuration for HStreamDB Action"""
+
+hstreamdb_action.label:
+"""HStreamDB Action Configuration"""
+
+config_connector.desc:
+"""Configuration for an HStreamDB connector."""
+
+config_connector.label:
+"""HStreamDB Connector Configuration"""
+
 }