Преглед изворни кода

Update listener.api schema

turtled пре 8 година
родитељ
комит
70507e893c
1 измењених фајлова са 20 додато и 2 уклоњено
  1. 20 2
      priv/emq.schema

+ 20 - 2
priv/emq.schema

@@ -1021,14 +1021,32 @@ end}.
                        end
                    end,
 
+    ApiListeners = fun(Type, Name) ->
+                       Prefix = string:join(["listener", Type, Name], "."),
+                       case cuttlefish:conf_get(Prefix, Conf, undefined) of
+                           undefined ->
+                               [];
+                           ListenOn ->
+                               SslOpts1 = case SslOpts(Prefix) of
+                                        [] -> [];
+                                        SslOpts0 -> [{sslopts, SslOpts0}]
+                                      end,
+                               [{Atom(Type), ListenOn, [{connopts, ConnOpts(Prefix)},
+                                                        {sockopts, TcpOpts(Prefix)}| LisOpts(Prefix)] ++ SslOpts1}]
+                       end
+                   end,
+
+
     lists:flatten([TcpListeners(Type, Name) || {["listener", Type, Name], ListenOn}
                                                <- cuttlefish_variable:filter_by_prefix("listener.tcp", Conf)
                                                ++ cuttlefish_variable:filter_by_prefix("listener.ws", Conf)]
                   ++
                   [SslListeners(Type, Name) || {["listener", Type, Name], ListenOn}
                                                <- cuttlefish_variable:filter_by_prefix("listener.ssl", Conf)
-                                               ++ cuttlefish_variable:filter_by_prefix("listener.wss", Conf)
-                                               ++ cuttlefish_variable:filter_by_prefix("listener.api", Conf)])
+                                               ++ cuttlefish_variable:filter_by_prefix("listener.wss", Conf)]
+                  ++
+                  [ApiListeners(Type, Name) || {["listener", Type, Name], ListenOn}
+                                               <- cuttlefish_variable:filter_by_prefix("listener.api", Conf)])
 end}.
 
 %%--------------------------------------------------------------------