refactor: the MongoDB connector into its own application
This commit is contained in:
parent
e3199ef813
commit
b78a75bb5c
|
@ -3,7 +3,8 @@
|
||||||
{deps, [
|
{deps, [
|
||||||
{emqx, {path, "../emqx"}},
|
{emqx, {path, "../emqx"}},
|
||||||
{emqx_utils, {path, "../emqx_utils"}},
|
{emqx_utils, {path, "../emqx_utils"}},
|
||||||
{emqx_connector, {path, "../emqx_connector"}}
|
{emqx_connector, {path, "../emqx_connector"}},
|
||||||
|
{emqx_mongodb, {path, "../emqx_mongodb"}}
|
||||||
]}.
|
]}.
|
||||||
|
|
||||||
{edoc_opts, [{preprocess, true}]}.
|
{edoc_opts, [{preprocess, true}]}.
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
{vsn, "0.1.22"},
|
{vsn, "0.1.22"},
|
||||||
{modules, []},
|
{modules, []},
|
||||||
{registered, [emqx_authn_sup, emqx_authn_registry]},
|
{registered, [emqx_authn_sup, emqx_authn_registry]},
|
||||||
{applications, [kernel, stdlib, emqx_resource, emqx_connector, ehttpc, epgsql, mysql, jose]},
|
{applications, [kernel, stdlib, emqx_resource, emqx_connector, ehttpc, epgsql, mysql, jose, emqx_mongodb]},
|
||||||
{mod, {emqx_authn_app, []}},
|
{mod, {emqx_authn_app, []}},
|
||||||
{env, []},
|
{env, []},
|
||||||
{licenses, ["Apache-2.0"]},
|
{licenses, ["Apache-2.0"]},
|
||||||
|
|
|
@ -4,7 +4,8 @@
|
||||||
{deps, [
|
{deps, [
|
||||||
{emqx, {path, "../emqx"}},
|
{emqx, {path, "../emqx"}},
|
||||||
{emqx_utils, {path, "../emqx_utils"}},
|
{emqx_utils, {path, "../emqx_utils"}},
|
||||||
{emqx_connector, {path, "../emqx_connector"}}
|
{emqx_connector, {path, "../emqx_connector"}},
|
||||||
|
{emqx_mongodb, {path, "../emqx_mongodb"}}
|
||||||
]}.
|
]}.
|
||||||
|
|
||||||
{shell, [
|
{shell, [
|
||||||
|
|
|
@ -9,7 +9,8 @@
|
||||||
stdlib,
|
stdlib,
|
||||||
crypto,
|
crypto,
|
||||||
emqx_resource,
|
emqx_resource,
|
||||||
emqx_connector
|
emqx_connector,
|
||||||
|
emqx_mongodb
|
||||||
]},
|
]},
|
||||||
{env, []},
|
{env, []},
|
||||||
{modules, []},
|
{modules, []},
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
{deps, [ {emqx_connector, {path, "../../apps/emqx_connector"}}
|
{deps, [ {emqx_connector, {path, "../../apps/emqx_connector"}}
|
||||||
, {emqx_resource, {path, "../../apps/emqx_resource"}}
|
, {emqx_resource, {path, "../../apps/emqx_resource"}}
|
||||||
, {emqx_bridge, {path, "../../apps/emqx_bridge"}}
|
, {emqx_bridge, {path, "../../apps/emqx_bridge"}}
|
||||||
|
, {emqx_mongodb, {path, "../../apps/emqx_mongodb"}}
|
||||||
, {emqx_ee_bridge, {path, "../../lib-ee/emqx_ee_bridge"}}
|
, {emqx_ee_bridge, {path, "../../lib-ee/emqx_ee_bridge"}}
|
||||||
]}.
|
]}.
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
emqx_resource,
|
emqx_resource,
|
||||||
emqx_bridge,
|
emqx_bridge,
|
||||||
emqx_ee_bridge,
|
emqx_ee_bridge,
|
||||||
mongodb]},
|
emqx_mongodb]},
|
||||||
{env, []},
|
{env, []},
|
||||||
{modules, []},
|
{modules, []},
|
||||||
{links, []}
|
{links, []}
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
mongo
|
|
||||||
redis
|
redis
|
||||||
redis_cluster
|
redis_cluster
|
||||||
mysql
|
mysql
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
{eldap2, {git, "https://github.com/emqx/eldap2", {tag, "v0.2.2"}}},
|
{eldap2, {git, "https://github.com/emqx/eldap2", {tag, "v0.2.2"}}},
|
||||||
{mysql, {git, "https://github.com/emqx/mysql-otp", {tag, "1.7.2"}}},
|
{mysql, {git, "https://github.com/emqx/mysql-otp", {tag, "1.7.2"}}},
|
||||||
{epgsql, {git, "https://github.com/emqx/epgsql", {tag, "4.7.0.1"}}},
|
{epgsql, {git, "https://github.com/emqx/epgsql", {tag, "4.7.0.1"}}},
|
||||||
{mongodb, {git, "https://github.com/emqx/mongodb-erlang", {tag, "v3.0.19"}}},
|
|
||||||
%% NOTE: mind ecpool version when updating eredis_cluster version
|
%% NOTE: mind ecpool version when updating eredis_cluster version
|
||||||
{eredis_cluster, {git, "https://github.com/emqx/eredis_cluster", {tag, "0.8.1"}}}
|
{eredis_cluster, {git, "https://github.com/emqx/eredis_cluster", {tag, "0.8.1"}}}
|
||||||
]}.
|
]}.
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
# MongoDB Connector
|
||||||
|
|
||||||
|
This application houses the MongoDB connector. The MongoDB connector is used by
|
||||||
|
emqx_authz, emqx_authn and emqx_bridge_mongodb applications to connect to
|
||||||
|
MongoDB.
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
Please see our [contributing.md](../../CONTRIBUTING.md).
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
Apache License, Version 2.0
|
||||||
|
|
||||||
|
See [APL.txt](../../APL.txt).
|
|
@ -0,0 +1 @@
|
||||||
|
mongo
|
|
@ -0,0 +1,7 @@
|
||||||
|
%% -*- mode: erlang; -*-
|
||||||
|
|
||||||
|
{erl_opts, [debug_info]}.
|
||||||
|
{deps, [ {emqx_connector, {path, "../../apps/emqx_connector"}}
|
||||||
|
, {emqx_resource, {path, "../../apps/emqx_resource"}}
|
||||||
|
, {mongodb, {git, "https://github.com/emqx/mongodb-erlang", {tag, "v3.0.19"}}}
|
||||||
|
]}.
|
|
@ -15,7 +15,7 @@
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
-module(emqx_connector_mongo).
|
-module(emqx_connector_mongo).
|
||||||
|
|
||||||
-include("emqx_connector.hrl").
|
-include_lib("emqx_connector/include/emqx_connector.hrl").
|
||||||
-include_lib("typerefl/include/types.hrl").
|
-include_lib("typerefl/include/types.hrl").
|
||||||
-include_lib("hocon/include/hoconsc.hrl").
|
-include_lib("hocon/include/hoconsc.hrl").
|
||||||
-include_lib("emqx/include/logger.hrl").
|
-include_lib("emqx/include/logger.hrl").
|
|
@ -0,0 +1,16 @@
|
||||||
|
{application, emqx_mongodb, [
|
||||||
|
{description, "EMQX MongoDB Connector"},
|
||||||
|
{vsn, "0.1.0"},
|
||||||
|
{registered, []},
|
||||||
|
{applications, [
|
||||||
|
kernel,
|
||||||
|
stdlib,
|
||||||
|
mongodb,
|
||||||
|
emqx_connector,
|
||||||
|
emqx_resource
|
||||||
|
]},
|
||||||
|
{env, []},
|
||||||
|
{modules, []},
|
||||||
|
|
||||||
|
{links, []}
|
||||||
|
]}.
|
|
@ -11,4 +11,4 @@ Please see our [contributing.md](../../CONTRIBUTING.md).
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
See [BSL](./BSL.txt).
|
See [BSL](../../APL.txt).
|
||||||
|
|
1
mix.exs
1
mix.exs
|
@ -377,6 +377,7 @@ defmodule EMQXUmbrella.MixProject do
|
||||||
emqx_psk: :permanent,
|
emqx_psk: :permanent,
|
||||||
emqx_slow_subs: :permanent,
|
emqx_slow_subs: :permanent,
|
||||||
emqx_plugins: :permanent,
|
emqx_plugins: :permanent,
|
||||||
|
emqx_mongodb: :permanent,
|
||||||
emqx_mix: :none
|
emqx_mix: :none
|
||||||
] ++
|
] ++
|
||||||
if(enable_quicer?(), do: [quicer: :permanent], else: []) ++
|
if(enable_quicer?(), do: [quicer: :permanent], else: []) ++
|
||||||
|
|
|
@ -439,6 +439,7 @@ relx_apps(ReleaseType, Edition) ->
|
||||||
emqx_prometheus,
|
emqx_prometheus,
|
||||||
emqx_psk,
|
emqx_psk,
|
||||||
emqx_slow_subs,
|
emqx_slow_subs,
|
||||||
|
emqx_mongodb,
|
||||||
emqx_plugins
|
emqx_plugins
|
||||||
] ++
|
] ++
|
||||||
[quicer || is_quicer_supported()] ++
|
[quicer || is_quicer_supported()] ++
|
||||||
|
|
Loading…
Reference in New Issue