docs: add type namespaces

This commit is contained in:
Zaiming (Stone) Shi 2023-11-16 20:36:55 +01:00
parent 869e73d637
commit 1b2c052646
15 changed files with 31 additions and 13 deletions

View File

@ -22,6 +22,7 @@
-behaviour(emqx_authz_schema). -behaviour(emqx_authz_schema).
-export([ -export([
namespace/0,
type/0, type/0,
fields/1, fields/1,
desc/1, desc/1,
@ -30,6 +31,8 @@
select_union_member/1 select_union_member/1
]). ]).
namespace() -> "authz".
type() -> ?AUTHZ_TYPE. type() -> ?AUTHZ_TYPE.
fields(file) -> fields(file) ->

View File

@ -79,8 +79,7 @@
upgrade_raw_conf(RawConf) -> upgrade_raw_conf(RawConf) ->
emqx_connector_schema:transform_bridges_v1_to_connectors_and_bridges_v2(RawConf). emqx_connector_schema:transform_bridges_v1_to_connectors_and_bridges_v2(RawConf).
%% root config should not have a namespace namespace() -> emqx.
namespace() -> undefined.
tags() -> tags() ->
[<<"EMQX">>]. [<<"EMQX">>].

View File

@ -12,6 +12,7 @@
-behaviour(emqx_dashboard_sso). -behaviour(emqx_dashboard_sso).
-export([ -export([
namespace/0,
hocon_ref/0, hocon_ref/0,
login_ref/0, login_ref/0,
fields/1, fields/1,
@ -43,6 +44,8 @@
%% Hocon Schema %% Hocon Schema
%%------------------------------------------------------------------------------ %%------------------------------------------------------------------------------
namespace() -> "dashboard".
hocon_ref() -> hocon_ref() ->
hoconsc:ref(?MODULE, saml). hoconsc:ref(?MODULE, saml).

View File

@ -21,7 +21,7 @@
%%------------------------------------------------------------------------------ %%------------------------------------------------------------------------------
%% Hocon Schema %% Hocon Schema
%%------------------------------------------------------------------------------ %%------------------------------------------------------------------------------
namespace() -> "sso". namespace() -> dashboard.
fields(sso) -> fields(sso) ->
lists:map( lists:map(

View File

@ -26,7 +26,9 @@
-reflect_type([duration/0]). -reflect_type([duration/0]).
%% config schema provides %% config schema provides
-export([fields/1, desc/1]). -export([namespace/0, fields/1, desc/1]).
namespace() -> "gateway".
fields(coap) -> fields(coap) ->
[ [

View File

@ -28,7 +28,9 @@
]). ]).
%% config schema provides %% config schema provides
-export([fields/1, desc/1]). -export([namespace/0, fields/1, desc/1]).
namespace() -> "gateway".
fields(exproto) -> fields(exproto) ->
[ [

View File

@ -1,6 +1,6 @@
{application, emqx_gateway_exproto, [ {application, emqx_gateway_exproto, [
{description, "ExProto Gateway"}, {description, "ExProto Gateway"},
{vsn, "0.1.4"}, {vsn, "0.1.5"},
{registered, []}, {registered, []},
{applications, [kernel, stdlib, grpc, emqx, emqx_gateway]}, {applications, [kernel, stdlib, grpc, emqx, emqx_gateway]},
{env, []}, {env, []},

View File

@ -1,6 +1,6 @@
{application, emqx_gateway_lwm2m, [ {application, emqx_gateway_lwm2m, [
{description, "LwM2M Gateway"}, {description, "LwM2M Gateway"},
{vsn, "0.1.3"}, {vsn, "0.1.4"},
{registered, []}, {registered, []},
{applications, [kernel, stdlib, emqx, emqx_gateway, emqx_gateway_coap]}, {applications, [kernel, stdlib, emqx, emqx_gateway, emqx_gateway_coap]},
{env, []}, {env, []},

View File

@ -28,7 +28,9 @@
-reflect_type([duration/0, duration_s/0]). -reflect_type([duration/0, duration_s/0]).
%% config schema provides %% config schema provides
-export([fields/1, desc/1]). -export([namespace/0, fields/1, desc/1]).
namespace() -> gateway.
fields(lwm2m) -> fields(lwm2m) ->
[ [

View File

@ -1,6 +1,6 @@
{application, emqx_gateway_mqttsn, [ {application, emqx_gateway_mqttsn, [
{description, "MQTT-SN Gateway"}, {description, "MQTT-SN Gateway"},
{vsn, "0.1.5"}, {vsn, "0.1.6"},
{registered, []}, {registered, []},
{applications, [kernel, stdlib, emqx, emqx_gateway]}, {applications, [kernel, stdlib, emqx, emqx_gateway]},
{env, []}, {env, []},

View File

@ -21,7 +21,9 @@
-include_lib("typerefl/include/types.hrl"). -include_lib("typerefl/include/types.hrl").
%% config schema provides %% config schema provides
-export([fields/1, desc/1]). -export([namespace/0, fields/1, desc/1]).
namespace() -> "gateway".
fields(mqttsn) -> fields(mqttsn) ->
[ [

View File

@ -20,7 +20,9 @@
-include_lib("typerefl/include/types.hrl"). -include_lib("typerefl/include/types.hrl").
%% config schema provides %% config schema provides
-export([fields/1, desc/1]). -export([namespace/0, fields/1, desc/1]).
namespace() -> "gateway".
fields(stomp) -> fields(stomp) ->
[ [

View File

@ -30,7 +30,7 @@
-define(INVALID_SPEC(_REASON_), throw({_REASON_, #{default => ?DEFAULT_INDICES}})). -define(INVALID_SPEC(_REASON_), throw({_REASON_, #{default => ?DEFAULT_INDICES}})).
namespace() -> "retainer". namespace() -> retainer.
roots() -> roots() ->
[ [

View File

@ -1,6 +1,6 @@
{application, emqx_schema_registry, [ {application, emqx_schema_registry, [
{description, "EMQX Schema Registry"}, {description, "EMQX Schema Registry"},
{vsn, "0.1.7"}, {vsn, "0.1.8"},
{registered, [emqx_schema_registry_sup]}, {registered, [emqx_schema_registry_sup]},
{mod, {emqx_schema_registry_app, []}}, {mod, {emqx_schema_registry_app, []}},
{included_applications, [ {included_applications, [

View File

@ -10,6 +10,7 @@
%% `hocon_schema' API %% `hocon_schema' API
-export([ -export([
namespace/0,
roots/0, roots/0,
fields/1, fields/1,
desc/1, desc/1,
@ -26,6 +27,8 @@
%% `hocon_schema' APIs %% `hocon_schema' APIs
%%------------------------------------------------------------------------------ %%------------------------------------------------------------------------------
namespace() -> ?CONF_KEY_ROOT.
roots() -> roots() ->
[{?CONF_KEY_ROOT, mk(ref(?CONF_KEY_ROOT), #{required => false})}]. [{?CONF_KEY_ROOT, mk(ref(?CONF_KEY_ROOT), #{required => false})}].