Преглед на файлове

refactor(hstreamdb): HStreamDB bridge to its own application

JimMoen преди 2 години
родител
ревизия
d31a305bcb

+ 11 - 0
apps/emqx_bridge_hstreamdb/rebar.config

@@ -0,0 +1,11 @@
+%% -*- mode: erlang -*-
+{erl_opts, [debug_info]}.
+{deps, [
+  {hstreamdb_erl, {git, "https://github.com/hstreamdb/hstreamdb_erl.git", {tag, "0.2.5"}}},
+  {emqx, {path, "../../apps/emqx"}},
+  {emqx_utils, {path, "../../apps/emqx_utils"}}
+]}.
+
+{shell, [
+    {apps, [emqx_bridge_hstreamdb]}
+]}.

+ 1 - 1
apps/emqx_bridge_hstreamdb/src/emqx_bridge_hstreamdb.app.src

@@ -1,6 +1,6 @@
 {application, emqx_bridge_hstreamdb, [
 {application, emqx_bridge_hstreamdb, [
     {description, "EMQX Enterprise HStreamDB Bridge"},
     {description, "EMQX Enterprise HStreamDB Bridge"},
-    {vsn, "0.1.0"},
+    {vsn, "0.1.1"},
     {registered, []},
     {registered, []},
     {applications, [kernel, stdlib]},
     {applications, [kernel, stdlib]},
     {env, []},
     {env, []},

+ 2 - 2
lib-ee/emqx_ee_bridge/src/emqx_ee_bridge_hstreamdb.erl

@@ -1,7 +1,7 @@
 %%--------------------------------------------------------------------
 %%--------------------------------------------------------------------
 %% Copyright (c) 2022-2023 EMQ Technologies Co., Ltd. All Rights Reserved.
 %% Copyright (c) 2022-2023 EMQ Technologies Co., Ltd. All Rights Reserved.
 %%--------------------------------------------------------------------
 %%--------------------------------------------------------------------
--module(emqx_ee_bridge_hstreamdb).
+-module(emqx_bridge_hstreamdb).
 
 
 -include_lib("typerefl/include/types.hrl").
 -include_lib("typerefl/include/types.hrl").
 -include_lib("hocon/include/hoconsc.hrl").
 -include_lib("hocon/include/hoconsc.hrl").
@@ -66,7 +66,7 @@ fields("get") ->
 
 
 field(connector) ->
 field(connector) ->
     mk(
     mk(
-        hoconsc:union([binary(), ref(emqx_ee_connector_hstreamdb, config)]),
+        hoconsc:union([binary(), ref(emqx_bridge_hstreamdb_connector, config)]),
         #{
         #{
             required => true,
             required => true,
             example => <<"hstreamdb:demo">>,
             example => <<"hstreamdb:demo">>,

+ 1 - 1
lib-ee/emqx_ee_connector/src/emqx_ee_connector_hstreamdb.erl

@@ -1,7 +1,7 @@
 %%--------------------------------------------------------------------
 %%--------------------------------------------------------------------
 %% Copyright (c) 2022-2023 EMQ Technologies Co., Ltd. All Rights Reserved.
 %% Copyright (c) 2022-2023 EMQ Technologies Co., Ltd. All Rights Reserved.
 %%--------------------------------------------------------------------
 %%--------------------------------------------------------------------
--module(emqx_ee_connector_hstreamdb).
+-module(emqx_bridge_hstreamdb_connector).
 
 
 -include_lib("hocon/include/hoconsc.hrl").
 -include_lib("hocon/include/hoconsc.hrl").
 -include_lib("typerefl/include/types.hrl").
 -include_lib("typerefl/include/types.hrl").

+ 1 - 1
lib-ee/emqx_ee_bridge/test/ee_bridge_hstreamdb_SUITE.erl

@@ -2,7 +2,7 @@
 %% Copyright (c) 2022-2023 EMQ Technologies Co., Ltd. All Rights Reserved.
 %% Copyright (c) 2022-2023 EMQ Technologies Co., Ltd. All Rights Reserved.
 %%--------------------------------------------------------------------
 %%--------------------------------------------------------------------
 
 
--module(ee_bridge_hstreamdb_SUITE).
+-module(emqx_bridge_hstreamdb_SUITE).
 
 
 -compile(nowarn_export_all).
 -compile(nowarn_export_all).
 -compile(export_all).
 -compile(export_all).

+ 1 - 1
lib-ee/emqx_ee_connector/test/emqx_ee_connector_hstreamdb_SUITE.erl

@@ -2,7 +2,7 @@
 %% Copyright (c) 2022-2023 EMQ Technologies Co., Ltd. All Rights Reserved.
 %% Copyright (c) 2022-2023 EMQ Technologies Co., Ltd. All Rights Reserved.
 %%--------------------------------------------------------------------
 %%--------------------------------------------------------------------
 
 
--module(emqx_ee_connector_hstreamdb_SUITE).
+-module(emqx_connector_hstreamdb_SUITE).
 
 
 -compile(nowarn_export_all).
 -compile(nowarn_export_all).
 -compile(export_all).
 -compile(export_all).

+ 4 - 4
lib-ee/emqx_ee_bridge/src/emqx_ee_bridge.erl

@@ -30,7 +30,7 @@ api_schemas(Method) ->
         api_ref(emqx_bridge_mongodb, <<"mongodb_rs">>, Method ++ "_rs"),
         api_ref(emqx_bridge_mongodb, <<"mongodb_rs">>, Method ++ "_rs"),
         api_ref(emqx_bridge_mongodb, <<"mongodb_sharded">>, Method ++ "_sharded"),
         api_ref(emqx_bridge_mongodb, <<"mongodb_sharded">>, Method ++ "_sharded"),
         api_ref(emqx_bridge_mongodb, <<"mongodb_single">>, Method ++ "_single"),
         api_ref(emqx_bridge_mongodb, <<"mongodb_single">>, Method ++ "_single"),
-        api_ref(emqx_ee_bridge_hstreamdb, <<"hstreamdb">>, Method),
+        api_ref(emqx_bridge_hstreamdb, <<"hstreamdb">>, Method),
         api_ref(emqx_bridge_influxdb, <<"influxdb_api_v1">>, Method ++ "_api_v1"),
         api_ref(emqx_bridge_influxdb, <<"influxdb_api_v1">>, Method ++ "_api_v1"),
         api_ref(emqx_bridge_influxdb, <<"influxdb_api_v2">>, Method ++ "_api_v2"),
         api_ref(emqx_bridge_influxdb, <<"influxdb_api_v2">>, Method ++ "_api_v2"),
         api_ref(emqx_bridge_redis, <<"redis_single">>, Method ++ "_single"),
         api_ref(emqx_bridge_redis, <<"redis_single">>, Method ++ "_single"),
@@ -54,7 +54,7 @@ schema_modules() ->
     [
     [
         emqx_bridge_kafka,
         emqx_bridge_kafka,
         emqx_bridge_cassandra,
         emqx_bridge_cassandra,
-        emqx_ee_bridge_hstreamdb,
+        emqx_bridge_hstreamdb,
         emqx_bridge_gcp_pubsub,
         emqx_bridge_gcp_pubsub,
         emqx_bridge_influxdb,
         emqx_bridge_influxdb,
         emqx_bridge_mongodb,
         emqx_bridge_mongodb,
@@ -93,7 +93,7 @@ resource_type(kafka_consumer) -> emqx_bridge_kafka_impl_consumer;
 %% to hocon; keeping this as just `kafka' for backwards compatibility.
 %% to hocon; keeping this as just `kafka' for backwards compatibility.
 resource_type(kafka) -> emqx_bridge_kafka_impl_producer;
 resource_type(kafka) -> emqx_bridge_kafka_impl_producer;
 resource_type(cassandra) -> emqx_bridge_cassandra_connector;
 resource_type(cassandra) -> emqx_bridge_cassandra_connector;
-resource_type(hstreamdb) -> emqx_ee_connector_hstreamdb;
+resource_type(hstreamdb) -> emqx_bridge_hstreamdb_connector;
 resource_type(gcp_pubsub) -> emqx_bridge_gcp_pubsub_impl_producer;
 resource_type(gcp_pubsub) -> emqx_bridge_gcp_pubsub_impl_producer;
 resource_type(gcp_pubsub_consumer) -> emqx_bridge_gcp_pubsub_impl_consumer;
 resource_type(gcp_pubsub_consumer) -> emqx_bridge_gcp_pubsub_impl_consumer;
 resource_type(mongodb_rs) -> emqx_bridge_mongodb_connector;
 resource_type(mongodb_rs) -> emqx_bridge_mongodb_connector;
@@ -123,7 +123,7 @@ fields(bridges) ->
     [
     [
         {hstreamdb,
         {hstreamdb,
             mk(
             mk(
-                hoconsc:map(name, ref(emqx_ee_bridge_hstreamdb, "config")),
+                hoconsc:map(name, ref(emqx_bridge_hstreamdb, "config")),
                 #{
                 #{
                     desc => <<"HStreamDB Bridge Config">>,
                     desc => <<"HStreamDB Bridge Config">>,
                     required => false
                     required => false

+ 0 - 1
lib-ee/emqx_ee_connector/rebar.config

@@ -1,7 +1,6 @@
 %% -*- mode: erlang -*-
 %% -*- mode: erlang -*-
 {erl_opts, [debug_info]}.
 {erl_opts, [debug_info]}.
 {deps, [
 {deps, [
-  {hstreamdb_erl, {git, "https://github.com/hstreamdb/hstreamdb_erl.git", {tag, "0.2.5"}}},
   {emqx, {path, "../../apps/emqx"}},
   {emqx, {path, "../../apps/emqx"}},
   {emqx_utils, {path, "../../apps/emqx_utils"}}
   {emqx_utils, {path, "../../apps/emqx_utils"}}
 ]}.
 ]}.

+ 1 - 1
rel/i18n/emqx_ee_bridge_hstreamdb.hocon

@@ -1,4 +1,4 @@
-emqx_ee_bridge_hstreamdb {
+emqx_bridge_hstreamdb {
 
 
 config_direction.desc:
 config_direction.desc:
 """The direction of this bridge, MUST be 'egress'"""
 """The direction of this bridge, MUST be 'egress'"""

+ 1 - 1
rel/i18n/emqx_ee_connector_hstreamdb.hocon

@@ -1,4 +1,4 @@
-emqx_ee_connector_hstreamdb {
+emqx_bridge_hstreamdb_connector {
 
 
 config.desc:
 config.desc:
 """HStreamDB connection config"""
 """HStreamDB connection config"""