refactor(schema): add namespace/0 to all schema modules
This commit is contained in:
parent
7b59d46854
commit
d603de10e6
|
@ -20,7 +20,7 @@
|
||||||
-behaviour(ecpool_worker).
|
-behaviour(ecpool_worker).
|
||||||
|
|
||||||
%% hocon_schema callbacks
|
%% hocon_schema callbacks
|
||||||
-export([roots/0, fields/1]).
|
-export([namespace/0, roots/0, fields/1]).
|
||||||
|
|
||||||
%% HTTP API callbacks
|
%% HTTP API callbacks
|
||||||
-export([values/1]).
|
-export([values/1]).
|
||||||
|
@ -43,6 +43,8 @@
|
||||||
%% Internal callbacks
|
%% Internal callbacks
|
||||||
-export([publish_messages/3]).
|
-export([publish_messages/3]).
|
||||||
|
|
||||||
|
namespace() -> "rabbitmq".
|
||||||
|
|
||||||
roots() ->
|
roots() ->
|
||||||
[{config, #{type => hoconsc:ref(?MODULE, config)}}].
|
[{config, #{type => hoconsc:ref(?MODULE, config)}}].
|
||||||
|
|
||||||
|
|
|
@ -13,12 +13,14 @@
|
||||||
|
|
||||||
-behaviour(hocon_schema).
|
-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([
|
-export([
|
||||||
default_license/0
|
default_license/0
|
||||||
]).
|
]).
|
||||||
|
|
||||||
|
namespace() -> "license".
|
||||||
|
|
||||||
roots() ->
|
roots() ->
|
||||||
[
|
[
|
||||||
{license,
|
{license,
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
-export([check_params/2]).
|
-export([check_params/2]).
|
||||||
|
|
||||||
-export([roots/0, fields/1]).
|
-export([namespace/0, roots/0, fields/1]).
|
||||||
|
|
||||||
-type tag() :: rule_creation | rule_test | rule_engine.
|
-type tag() :: rule_creation | rule_test | rule_engine.
|
||||||
|
|
||||||
|
@ -46,6 +46,8 @@ check_params(Params, Tag) ->
|
||||||
%%======================================================================================
|
%%======================================================================================
|
||||||
%% Hocon Schema Definitions
|
%% Hocon Schema Definitions
|
||||||
|
|
||||||
|
namespace() -> "rule_engine".
|
||||||
|
|
||||||
roots() ->
|
roots() ->
|
||||||
[
|
[
|
||||||
{"rule_engine", sc(ref("rule_engine"), #{desc => ?DESC("root_rule_engine")})},
|
{"rule_engine", sc(ref("rule_engine"), #{desc => ?DESC("root_rule_engine")})},
|
||||||
|
|
|
@ -22,11 +22,15 @@
|
||||||
-behaviour(hocon_schema).
|
-behaviour(hocon_schema).
|
||||||
|
|
||||||
-export([
|
-export([
|
||||||
|
namespace/0,
|
||||||
roots/0,
|
roots/0,
|
||||||
fields/1,
|
fields/1,
|
||||||
desc/1
|
desc/1
|
||||||
]).
|
]).
|
||||||
|
|
||||||
|
%% 'emqxtel' to distinguish open-telemetry
|
||||||
|
namespace() -> "emqxtel".
|
||||||
|
|
||||||
roots() -> ["telemetry"].
|
roots() -> ["telemetry"].
|
||||||
|
|
||||||
fields("telemetry") ->
|
fields("telemetry") ->
|
||||||
|
|
Loading…
Reference in New Issue