refactor(schema): add namespace/0 to all schema modules

This commit is contained in:
Zaiming (Stone) Shi 2023-11-08 23:13:26 +01:00
parent 7b59d46854
commit d603de10e6
5 changed files with 14 additions and 4 deletions

View File

@ -20,7 +20,7 @@
-behaviour(ecpool_worker).
%% hocon_schema callbacks
-export([roots/0, fields/1]).
-export([namespace/0, roots/0, fields/1]).
%% HTTP API callbacks
-export([values/1]).
@ -43,6 +43,8 @@
%% Internal callbacks
-export([publish_messages/3]).
namespace() -> "rabbitmq".
roots() ->
[{config, #{type => hoconsc:ref(?MODULE, config)}}].

View File

@ -59,7 +59,7 @@
%% Hocon schema
namespace() -> "ldap".
roots() ->
[{config, #{type => hoconsc:ref(?MODULE, config)}}].

View File

@ -13,12 +13,14 @@
-behaviour(hocon_schema).
-export([roots/0, fields/1, validations/0, desc/1, tags/0]).
-export([namespace/0, roots/0, fields/1, validations/0, desc/1, tags/0]).
-export([
default_license/0
]).
namespace() -> "license".
roots() ->
[
{license,

View File

@ -24,7 +24,7 @@
-export([check_params/2]).
-export([roots/0, fields/1]).
-export([namespace/0, roots/0, fields/1]).
-type tag() :: rule_creation | rule_test | rule_engine.
@ -46,6 +46,8 @@ check_params(Params, Tag) ->
%%======================================================================================
%% Hocon Schema Definitions
namespace() -> "rule_engine".
roots() ->
[
{"rule_engine", sc(ref("rule_engine"), #{desc => ?DESC("root_rule_engine")})},

View File

@ -22,11 +22,15 @@
-behaviour(hocon_schema).
-export([
namespace/0,
roots/0,
fields/1,
desc/1
]).
%% 'emqxtel' to distinguish open-telemetry
namespace() -> "emqxtel".
roots() -> ["telemetry"].
fields("telemetry") ->