Просмотр исходного кода

feat: make gateway and slow_subs low level and hide rule_engine

zhongwencool 2 лет назад
Родитель
Сommit
3331af4757

+ 1 - 1
apps/emqx_gateway/src/emqx_gateway_schema.erl

@@ -61,7 +61,7 @@ tags() ->
     [<<"Gateway">>].
 
 roots() ->
-    [{gateway, sc(ref(?MODULE, gateway), #{importance => ?IMPORTANCE_HIDDEN})}].
+    [{gateway, sc(ref(?MODULE, gateway), #{importance => ?IMPORTANCE_LOW})}].
 
 fields(gateway) ->
     lists:map(

+ 14 - 0
apps/emqx_gateway/src/emqx_gateway_utils.erl

@@ -532,6 +532,7 @@ default_subopts() ->
 
 -spec find_gateway_definitions() -> list(gateway_def()).
 find_gateway_definitions() ->
+    ensure_gateway_loaded(),
     lists:flatten(
         lists:map(
             fun(App) ->
@@ -617,3 +618,16 @@ plus_max_connections(infinity, _) ->
     infinity;
 plus_max_connections(A, B) when is_integer(A) andalso is_integer(B) ->
     A + B.
+
+%% we need to load all gateway applications before generate doc from cli
+ensure_gateway_loaded() ->
+    lists:foreach(
+        fun application:load/1,
+        [
+            emqx_gateway_exproto,
+            emqx_gateway_stomp,
+            emqx_gateway_coap,
+            emqx_gateway_lwm2m,
+            emqx_gateway_mqttsn
+        ]
+    ).

+ 1 - 1
apps/emqx_rule_engine/src/emqx_rule_engine_schema.erl

@@ -38,7 +38,7 @@ namespace() -> rule_engine.
 tags() ->
     [<<"Rule Engine">>].
 
-roots() -> [{"rule_engine", ?HOCON(?R_REF("rule_engine"), #{importance => ?IMPORTANCE_LOW})}].
+roots() -> [{"rule_engine", ?HOCON(?R_REF("rule_engine"), #{importance => ?IMPORTANCE_HIDDEN})}].
 
 fields("rule_engine") ->
     rule_engine_settings() ++

+ 1 - 1
apps/emqx_slow_subs/src/emqx_slow_subs_schema.erl

@@ -23,7 +23,7 @@
 namespace() -> "slow_subs".
 
 roots() ->
-    [{"slow_subs", ?HOCON(?R_REF("slow_subs"), #{importance => ?IMPORTANCE_HIDDEN})}].
+    [{"slow_subs", ?HOCON(?R_REF("slow_subs"), #{importance => ?IMPORTANCE_LOW})}].
 
 fields("slow_subs") ->
     [

+ 1 - 1
scripts/merge-config.escript

@@ -23,7 +23,7 @@ main(_) ->
 
 merge(BaseConf, Cfgs) ->
     Confs = [BaseConf | lists:map(fun read_conf/1, Cfgs)],
-    infix(lists:filter(fun(I) -> iolist_size(I) > 0 end, Confs), [io_lib:nl(), io_lib:nl()]).
+    infix(lists:filter(fun(I) -> iolist_size(I) > 0 end, Confs), [io_lib:nl()]).
 
 read_conf(CfgFile) ->
     case filelib:is_regular(CfgFile) of