fix: ee bridge & connector remove app mod

This commit is contained in:
DDDHuang 2022-07-26 15:54:58 +08:00
parent fa4bc921ac
commit be6de4aad0
11 changed files with 8 additions and 100 deletions

View File

@ -183,7 +183,7 @@ conn_bridge_examples(Method) ->
EE = ee_conn_bridge_examples(Method),
maps:merge(Broker, EE).
-ifdef(EMQX_RELEASE_EDITION).
-if(?EMQX_RELEASE_EDITION == ee).
ee_conn_bridge_examples(Method) ->
emqx_ee_bridge:conn_bridge_examples(Method).
-else.

View File

@ -42,7 +42,7 @@ stop(_State) ->
ok = emqx_bridge:unload_hook(),
ok.
-ifdef(EMQX_RELEASE_EDITION).
-if(?EMQX_RELEASE_EDITION == ee).
start_ee_apps() ->
{ok, _} = application:ensure_all_started(emqx_ee_bridge),
{ok, _} = application:ensure_all_started(emqx_ee_connector),

View File

@ -42,7 +42,7 @@
reset_metrics/1
]).
-ifdef(EMQX_RELEASE_EDITION).
-if(?EMQX_RELEASE_EDITION == ee).
bridge_to_resource_type(<<"mqtt">>) -> emqx_connector_mqtt;
bridge_to_resource_type(mqtt) -> emqx_connector_mqtt;
bridge_to_resource_type(<<"webhook">>) -> emqx_connector_http;
@ -291,11 +291,11 @@ parse_confs(Type = mqtt, Name, #{connector := ConnectorConfs, direction := Direc
parse_confs(Type, Name, Conf) ->
parse_enterprise_confs(Type, Name, Conf).
-ifdef(EMQX_RELEASE_EDITION).
-if(?EMQX_RELEASE_EDITION == ee).
parse_enterprise_confs(Type, Name, Conf) ->
emqx_ee_bridge:parse_conf(Type, Name, Conf).
-else.
parse_enterprise_confs(Type, Name, Conf) ->
parse_enterprise_confs(Type, Name, _Conf) ->
error({not_supported, Type, Name}).
-endif.

View File

@ -48,7 +48,7 @@ http_schema(Method) ->
ExtSchemas = [ref(Module, Method) || Module <- schema_modules()],
hoconsc:union(Schemas ++ ExtSchemas).
-ifdef(EMQX_RELEASE_EDITION).
-if(?EMQX_RELEASE_EDITION == ee).
schema_modules() ->
[emqx_bridge_webhook_schema] ++ emqx_ee_bridge:schema_modules().
-else.
@ -158,7 +158,7 @@ fields("node_status") ->
{"status", mk(status(), #{})}
].
-ifdef(EMQX_RELEASE_EDITION).
-if(?EMQX_RELEASE_EDITION == ee).
ee_fields_bridges() ->
emqx_ee_bridge:fields(bridges).
-else.

View File

@ -1,8 +1,6 @@
{application, emqx_ee_bridge, [
{description, "An OTP application"},
{vsn, "0.1.0"},
{registered, []},
{mod, {emqx_ee_bridge_app, []}},
{applications, [
kernel,
stdlib

View File

@ -1,17 +0,0 @@
%%--------------------------------------------------------------------
%% Copyright (c) 2022 EMQ Technologies Co., Ltd. All Rights Reserved.
%%--------------------------------------------------------------------
-module(emqx_ee_bridge_app).
-behaviour(application).
-export([start/2, stop/1]).
start(_StartType, _StartArgs) ->
emqx_ee_bridge_sup:start_link().
stop(_State) ->
ok.
%% internal functions

View File

@ -1,27 +0,0 @@
%%--------------------------------------------------------------------
%% Copyright (c) 2022 EMQ Technologies Co., Ltd. All Rights Reserved.
%%--------------------------------------------------------------------
-module(emqx_ee_bridge_sup).
-behaviour(supervisor).
-export([start_link/0]).
-export([init/1]).
-define(SERVER, ?MODULE).
start_link() ->
supervisor:start_link({local, ?SERVER}, ?MODULE, []).
init([]) ->
SupFlags = #{
strategy => one_for_all,
intensity => 0,
period => 1
},
ChildSpecs = [],
{ok, {SupFlags, ChildSpecs}}.
%% internal functions

View File

@ -1,6 +1,6 @@
{erl_opts, [debug_info]}.
{deps, [
{hstreamdb_erl, {git, "https://github.com/hstreamdb/hstreamdb_erl.git", {tag, "0.2.4"}}}
{hstreamdb_erl, {git, "https://github.com/hstreamdb/hstreamdb_erl.git", {tag, "0.2.5"}}}
]}.
{shell, [

View File

@ -1,8 +1,6 @@
{application, emqx_ee_connector, [
{description, "An OTP application"},
{vsn, "0.1.0"},
{registered, []},
{mod, {emqx_ee_connector_app, []}},
{applications, [
kernel,
stdlib,

View File

@ -1,17 +0,0 @@
%%--------------------------------------------------------------------
%% Copyright (c) 2022 EMQ Technologies Co., Ltd. All Rights Reserved.
%%--------------------------------------------------------------------
-module(emqx_ee_connector_app).
-behaviour(application).
-export([start/2, stop/1]).
start(_StartType, _StartArgs) ->
emqx_ee_connector_sup:start_link().
stop(_State) ->
ok.
%% internal functions

View File

@ -1,27 +0,0 @@
%%--------------------------------------------------------------------
%% Copyright (c) 2022 EMQ Technologies Co., Ltd. All Rights Reserved.
%%--------------------------------------------------------------------
-module(emqx_ee_connector_sup).
-behaviour(supervisor).
-export([start_link/0]).
-export([init/1]).
-define(SERVER, ?MODULE).
start_link() ->
supervisor:start_link({local, ?SERVER}, ?MODULE, []).
init([]) ->
SupFlags = #{
strategy => one_for_all,
intensity => 0,
period => 1
},
ChildSpecs = [],
{ok, {SupFlags, ChildSpecs}}.
%% internal functions