From 5e442fcbca4286d4eddacf0c0b5790afae1a9a43 Mon Sep 17 00:00:00 2001 From: Kjell Winblad Date: Thu, 15 Feb 2024 11:08:08 +0100 Subject: [PATCH] fix: labels and descriptions --- .../src/emqx_bridge_hstreamdb.erl | 30 ++++++++--- rel/i18n/emqx_bridge_hstreamdb.hocon | 54 +++++++++++++++++++ 2 files changed, 78 insertions(+), 6 deletions(-) diff --git a/apps/emqx_bridge_hstreamdb/src/emqx_bridge_hstreamdb.erl b/apps/emqx_bridge_hstreamdb/src/emqx_bridge_hstreamdb.erl index ee0baaa4c..0556a731d 100644 --- a/apps/emqx_bridge_hstreamdb/src/emqx_bridge_hstreamdb.erl +++ b/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. diff --git a/rel/i18n/emqx_bridge_hstreamdb.hocon b/rel/i18n/emqx_bridge_hstreamdb.hocon index de9989953..70375dfbf 100644 --- a/rel/i18n/emqx_bridge_hstreamdb.hocon +++ b/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""" + }