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