Merge pull request #10662 from lafirest/refactor/pgsql_dir
refactor(pgsql): move pgsql && matrix && timescale bridges into their own app
This commit is contained in:
commit
c8758190b5
|
@ -0,0 +1,7 @@
|
||||||
|
{erl_opts, [debug_info]}.
|
||||||
|
|
||||||
|
{deps, [
|
||||||
|
{emqx_connector, {path, "../../apps/emqx_connector"}},
|
||||||
|
{emqx_resource, {path, "../../apps/emqx_resource"}},
|
||||||
|
{emqx_bridge, {path, "../../apps/emqx_bridge"}}
|
||||||
|
]}.
|
|
@ -1,6 +1,6 @@
|
||||||
{application, emqx_bridge_matrix, [
|
{application, emqx_bridge_matrix, [
|
||||||
{description, "EMQX Enterprise MatrixDB Bridge"},
|
{description, "EMQX Enterprise MatrixDB Bridge"},
|
||||||
{vsn, "0.1.0"},
|
{vsn, "0.1.1"},
|
||||||
{registered, []},
|
{registered, []},
|
||||||
{applications, [kernel, stdlib]},
|
{applications, [kernel, stdlib]},
|
||||||
{env, []},
|
{env, []},
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
%% Copyright (c) 2023 EMQ Technologies Co., Ltd. All Rights Reserved.
|
%% Copyright (c) 2023 EMQ Technologies Co., Ltd. All Rights Reserved.
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
-module(emqx_ee_bridge_matrix).
|
-module(emqx_bridge_matrix).
|
||||||
|
|
||||||
-export([
|
-export([
|
||||||
conn_bridge_examples/1
|
conn_bridge_examples/1
|
||||||
|
@ -22,7 +22,7 @@ conn_bridge_examples(Method) ->
|
||||||
#{
|
#{
|
||||||
<<"matrix">> => #{
|
<<"matrix">> => #{
|
||||||
summary => <<"Matrix Bridge">>,
|
summary => <<"Matrix Bridge">>,
|
||||||
value => emqx_ee_bridge_pgsql:values(Method, matrix)
|
value => emqx_bridge_pgsql:values(Method, matrix)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
].
|
].
|
||||||
|
@ -34,9 +34,9 @@ namespace() -> "bridge_matrix".
|
||||||
roots() -> [].
|
roots() -> [].
|
||||||
|
|
||||||
fields("post") ->
|
fields("post") ->
|
||||||
emqx_ee_bridge_pgsql:fields("post", matrix);
|
emqx_bridge_pgsql:fields("post", matrix);
|
||||||
fields(Method) ->
|
fields(Method) ->
|
||||||
emqx_ee_bridge_pgsql:fields(Method).
|
emqx_bridge_pgsql:fields(Method).
|
||||||
|
|
||||||
desc(_) ->
|
desc(_) ->
|
||||||
undefined.
|
undefined.
|
|
@ -0,0 +1,2 @@
|
||||||
|
toxiproxy
|
||||||
|
pgsql
|
|
@ -0,0 +1,7 @@
|
||||||
|
{erl_opts, [debug_info]}.
|
||||||
|
|
||||||
|
{deps, [
|
||||||
|
{emqx_connector, {path, "../../apps/emqx_connector"}},
|
||||||
|
{emqx_resource, {path, "../../apps/emqx_resource"}},
|
||||||
|
{emqx_bridge, {path, "../../apps/emqx_bridge"}}
|
||||||
|
]}.
|
|
@ -1,6 +1,6 @@
|
||||||
{application, emqx_bridge_pgsql, [
|
{application, emqx_bridge_pgsql, [
|
||||||
{description, "EMQX Enterprise PostgreSQL Bridge"},
|
{description, "EMQX Enterprise PostgreSQL Bridge"},
|
||||||
{vsn, "0.1.0"},
|
{vsn, "0.1.1"},
|
||||||
{registered, []},
|
{registered, []},
|
||||||
{applications, [kernel, stdlib]},
|
{applications, [kernel, stdlib]},
|
||||||
{env, []},
|
{env, []},
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
%% Copyright (c) 2022 EMQ Technologies Co., Ltd. All Rights Reserved.
|
%% Copyright (c) 2022-2023 EMQ Technologies Co., Ltd. All Rights Reserved.
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
-module(emqx_ee_bridge_pgsql).
|
-module(emqx_bridge_pgsql).
|
||||||
|
|
||||||
-include_lib("typerefl/include/types.hrl").
|
-include_lib("typerefl/include/types.hrl").
|
||||||
-include_lib("hocon/include/hoconsc.hrl").
|
-include_lib("hocon/include/hoconsc.hrl").
|
|
@ -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_bridge_pgsql_SUITE).
|
-module(emqx_bridge_pgsql_SUITE).
|
||||||
|
|
||||||
-compile(nowarn_export_all).
|
-compile(nowarn_export_all).
|
||||||
-compile(export_all).
|
-compile(export_all).
|
|
@ -0,0 +1,7 @@
|
||||||
|
{erl_opts, [debug_info]}.
|
||||||
|
|
||||||
|
{deps, [
|
||||||
|
{emqx_connector, {path, "../../apps/emqx_connector"}},
|
||||||
|
{emqx_resource, {path, "../../apps/emqx_resource"}},
|
||||||
|
{emqx_bridge, {path, "../../apps/emqx_bridge"}}
|
||||||
|
]}.
|
|
@ -1,6 +1,6 @@
|
||||||
{application, emqx_bridge_timescale, [
|
{application, emqx_bridge_timescale, [
|
||||||
{description, "EMQX Enterprise TimescaleDB Bridge"},
|
{description, "EMQX Enterprise TimescaleDB Bridge"},
|
||||||
{vsn, "0.1.0"},
|
{vsn, "0.1.1"},
|
||||||
{registered, []},
|
{registered, []},
|
||||||
{applications, [kernel, stdlib]},
|
{applications, [kernel, stdlib]},
|
||||||
{env, []},
|
{env, []},
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
%% Copyright (c) 2023 EMQ Technologies Co., Ltd. All Rights Reserved.
|
%% Copyright (c) 2023 EMQ Technologies Co., Ltd. All Rights Reserved.
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
-module(emqx_ee_bridge_timescale).
|
-module(emqx_bridge_timescale).
|
||||||
|
|
||||||
-export([
|
-export([
|
||||||
conn_bridge_examples/1
|
conn_bridge_examples/1
|
||||||
|
@ -22,7 +22,7 @@ conn_bridge_examples(Method) ->
|
||||||
#{
|
#{
|
||||||
<<"timescale">> => #{
|
<<"timescale">> => #{
|
||||||
summary => <<"Timescale Bridge">>,
|
summary => <<"Timescale Bridge">>,
|
||||||
value => emqx_ee_bridge_pgsql:values(Method, timescale)
|
value => emqx_bridge_pgsql:values(Method, timescale)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
].
|
].
|
||||||
|
@ -34,9 +34,9 @@ namespace() -> "bridge_timescale".
|
||||||
roots() -> [].
|
roots() -> [].
|
||||||
|
|
||||||
fields("post") ->
|
fields("post") ->
|
||||||
emqx_ee_bridge_pgsql:fields("post", timescale);
|
emqx_bridge_pgsql:fields("post", timescale);
|
||||||
fields(Method) ->
|
fields(Method) ->
|
||||||
emqx_ee_bridge_pgsql:fields(Method).
|
emqx_bridge_pgsql:fields(Method).
|
||||||
|
|
||||||
desc(_) ->
|
desc(_) ->
|
||||||
undefined.
|
undefined.
|
|
@ -0,0 +1 @@
|
||||||
|
Refactor the directory structure of the PostgreSQL && Matrix && Timescale data bridges.
|
|
@ -5,6 +5,5 @@ mongo_rs_sharded
|
||||||
mysql
|
mysql
|
||||||
redis
|
redis
|
||||||
redis_cluster
|
redis_cluster
|
||||||
pgsql
|
|
||||||
clickhouse
|
clickhouse
|
||||||
dynamo
|
dynamo
|
||||||
|
|
|
@ -19,7 +19,7 @@ api_schemas(Method) ->
|
||||||
ref(emqx_bridge_kafka, Method ++ "_producer"),
|
ref(emqx_bridge_kafka, Method ++ "_producer"),
|
||||||
ref(emqx_bridge_cassandra, Method),
|
ref(emqx_bridge_cassandra, Method),
|
||||||
ref(emqx_ee_bridge_mysql, Method),
|
ref(emqx_ee_bridge_mysql, Method),
|
||||||
ref(emqx_ee_bridge_pgsql, Method),
|
ref(emqx_bridge_pgsql, Method),
|
||||||
ref(emqx_ee_bridge_mongodb, Method ++ "_rs"),
|
ref(emqx_ee_bridge_mongodb, Method ++ "_rs"),
|
||||||
ref(emqx_ee_bridge_mongodb, Method ++ "_sharded"),
|
ref(emqx_ee_bridge_mongodb, Method ++ "_sharded"),
|
||||||
ref(emqx_ee_bridge_mongodb, Method ++ "_single"),
|
ref(emqx_ee_bridge_mongodb, Method ++ "_single"),
|
||||||
|
@ -29,8 +29,8 @@ api_schemas(Method) ->
|
||||||
ref(emqx_ee_bridge_redis, Method ++ "_single"),
|
ref(emqx_ee_bridge_redis, Method ++ "_single"),
|
||||||
ref(emqx_ee_bridge_redis, Method ++ "_sentinel"),
|
ref(emqx_ee_bridge_redis, Method ++ "_sentinel"),
|
||||||
ref(emqx_ee_bridge_redis, Method ++ "_cluster"),
|
ref(emqx_ee_bridge_redis, Method ++ "_cluster"),
|
||||||
ref(emqx_ee_bridge_timescale, Method),
|
ref(emqx_bridge_timescale, Method),
|
||||||
ref(emqx_ee_bridge_matrix, Method),
|
ref(emqx_bridge_matrix, Method),
|
||||||
ref(emqx_bridge_tdengine, Method),
|
ref(emqx_bridge_tdengine, Method),
|
||||||
ref(emqx_ee_bridge_clickhouse, Method),
|
ref(emqx_ee_bridge_clickhouse, Method),
|
||||||
ref(emqx_ee_bridge_dynamo, Method),
|
ref(emqx_ee_bridge_dynamo, Method),
|
||||||
|
@ -53,9 +53,9 @@ schema_modules() ->
|
||||||
emqx_ee_bridge_mongodb,
|
emqx_ee_bridge_mongodb,
|
||||||
emqx_ee_bridge_mysql,
|
emqx_ee_bridge_mysql,
|
||||||
emqx_ee_bridge_redis,
|
emqx_ee_bridge_redis,
|
||||||
emqx_ee_bridge_pgsql,
|
emqx_bridge_pgsql,
|
||||||
emqx_ee_bridge_timescale,
|
emqx_bridge_timescale,
|
||||||
emqx_ee_bridge_matrix,
|
emqx_bridge_matrix,
|
||||||
emqx_bridge_tdengine,
|
emqx_bridge_tdengine,
|
||||||
emqx_ee_bridge_clickhouse,
|
emqx_ee_bridge_clickhouse,
|
||||||
emqx_ee_bridge_dynamo,
|
emqx_ee_bridge_dynamo,
|
||||||
|
@ -280,7 +280,7 @@ pgsql_structs() ->
|
||||||
[
|
[
|
||||||
{Type,
|
{Type,
|
||||||
mk(
|
mk(
|
||||||
hoconsc:map(name, ref(emqx_ee_bridge_pgsql, "config")),
|
hoconsc:map(name, ref(emqx_bridge_pgsql, "config")),
|
||||||
#{
|
#{
|
||||||
desc => <<Name/binary, " Bridge Config">>,
|
desc => <<Name/binary, " Bridge Config">>,
|
||||||
required => false
|
required => false
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
emqx_ee_bridge_pgsql {
|
emqx_bridge_pgsql {
|
||||||
|
|
||||||
config_enable.desc:
|
config_enable.desc:
|
||||||
"""Enable or disable this bridge"""
|
"""Enable or disable this bridge"""
|
|
@ -1,4 +1,4 @@
|
||||||
emqx_ee_bridge_pgsql {
|
emqx_bridge_pgsql {
|
||||||
|
|
||||||
config_enable.desc:
|
config_enable.desc:
|
||||||
"""启用/禁用桥接"""
|
"""启用/禁用桥接"""
|
Loading…
Reference in New Issue