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

refactor(schema): description use binary

JimMoen пре 4 година
родитељ
комит
f30c16e47c
1 измењених фајлова са 10 додато и 4 уклоњено
  1. 10 4
      apps/emqx_modules/src/emqx_modules_schema.erl

+ 10 - 4
apps/emqx_modules/src/emqx_modules_schema.erl

@@ -43,10 +43,16 @@ fields("delayed") ->
     ];
 
 fields("rewrite") ->
-    [ {action, sc(hoconsc:enum([subscribe, publish, all]), #{desc => "Action", example => publish})}
-    , {source_topic, sc(binary(), #{desc => "Origin Topic", example => "x/#"})}
-    , {dest_topic, sc(binary(), #{desc => "Destination Topic", example => "z/y/$1"})}
-    , {re, fun regular_expression/1 }
+    [ { action
+      , sc( hoconsc:enum([subscribe, publish, all])
+          , #{desc => <<"Action">>, example => publish})}
+    , { source_topic
+      , sc( binary()
+          , #{desc => <<"Origin Topic">>, example => "x/#"})}
+    , { dest_topic
+      , sc( binary()
+          , #{desc => <<"Destination Topic">>, example => "z/y/$1"})}
+    , { re, fun regular_expression/1 }
     ];