refactor(emqx_machine_schema): use hoconsc:map type
This commit is contained in:
parent
bbd1c142de
commit
0039bfca6b
|
@ -78,8 +78,11 @@ namespace() -> undefined.
|
|||
roots() ->
|
||||
[{"zones",
|
||||
sc(map("name", ref("zone")),
|
||||
#{ desc => "A zones is a set configs grouped per the zone's name, there is a builtin zone named 'default' "
|
||||
"The name of a zone can be bound to listners to apply zone settings to connections accepted by the bound listener."
|
||||
#{ desc => "A zone is a set of configs grouped by the zone `$name`. <br>"
|
||||
"The `$name` can be set to a listner's `zone` config for "
|
||||
"flexible configuration mapping. <br>"
|
||||
"NOTE: A builtin zone named `default` is auto created "
|
||||
"and can not be deleted."
|
||||
})},
|
||||
"mqtt",
|
||||
"flapping_detect",
|
||||
|
|
|
@ -381,7 +381,7 @@ fields("rpc") ->
|
|||
fields("log") ->
|
||||
[ {"console_handler", ref("console_handler")}
|
||||
, {"file_handlers",
|
||||
sc(ref("file_handlers"),
|
||||
sc(map(name, ref("log_file_handler")),
|
||||
#{})}
|
||||
, {"error_logger",
|
||||
sc(atom(),
|
||||
|
@ -396,12 +396,6 @@ fields("console_handler") ->
|
|||
})}
|
||||
] ++ log_handler_common_confs();
|
||||
|
||||
fields("file_handlers") ->
|
||||
[ {"$name",
|
||||
sc(ref("log_file_handler"),
|
||||
#{})}
|
||||
];
|
||||
|
||||
fields("log_file_handler") ->
|
||||
[ {"file",
|
||||
sc(file(),
|
||||
|
@ -701,6 +695,8 @@ keys(Parent, Conf) ->
|
|||
|
||||
sc(Type, Meta) -> hoconsc:mk(Type, Meta).
|
||||
|
||||
map(Name, Type) -> hoconsc:map(Name, Type).
|
||||
|
||||
ref(Field) -> hoconsc:ref(?MODULE, Field).
|
||||
|
||||
options(static, Conf) ->
|
||||
|
|
Loading…
Reference in New Issue