Skip to content

Commit cbfb5f0

Browse files
authored
Merge pull request #288 from zmstone/0214-namespace-0-is-not-optional
refactor: make namespace/0 a non-optional export
2 parents 3912cae + b99bd9e commit cbfb5f0

12 files changed

+23
-16
lines changed

sample-schemas/demo_schema.erl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@
1414

1515
-reflect_type([duration/0, percent/0]).
1616

17-
-export([roots/0, fields/1, translations/0, translation/1]).
17+
-export([roots/0, fields/1, translations/0, translation/1, namespace/0]).
1818

1919
-define(FIELD(NAME, TYPE), hoconsc:mk(TYPE, #{mapping => NAME})).
2020

21+
namespace() -> "demo".
2122
roots() -> [foo, {"a_b", hoconsc:mk(hoconsc:ref("a_b"), #{importance => hidden})}, "b", person, "vm"].
2223
translations() -> ["app_foo"].
2324

sample-schemas/emqx_auth_http_schema.erl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44

55
-behaviour(hocon_schema).
66

7-
-export([roots/0, fields/1, translations/0, translation/1]).
7+
-export([roots/0, fields/1, translations/0, translation/1, namespace/0]).
88

9+
namespace() -> "auth_http".
910
roots() -> ["auth"].
1011

1112
fields("auth") ->

sample-schemas/emqx_auth_jwt_schema.erl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44

55
-behaviour(hocon_schema).
66

7-
-export([roots/0, fields/1, translations/0, translation/1]).
7+
-export([roots/0, fields/1, translations/0, translation/1, namespace/0]).
88

9+
namespace() -> "auth_jwt".
910
roots() -> ["auth"].
1011

1112
fields("auth") ->

sample-schemas/emqx_auth_ldap_schema.erl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44

55
-behaviour(hocon_schema).
66

7-
-export([roots/0, fields/1, translations/0, translation/1]).
7+
-export([roots/0, fields/1, translations/0, translation/1, namespace/0]).
88

9+
namespace() -> "auth_ldap".
910
roots() -> ["auth"].
1011

1112
fields("auth") ->

sample-schemas/emqx_auth_mnesia_schema.erl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44

55
-behaviour(hocon_schema).
66

7-
-export([roots/0, fields/1, translations/0, translation/1]).
7+
-export([roots/0, fields/1, translations/0, translation/1, namespace/0]).
88

9+
namespace() -> "auth_mnesia".
910
roots() -> ["auth"].
1011

1112
fields("auth") ->

sample-schemas/emqx_auth_mongo_schema.erl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111

1212
-reflect_type([type/0, w_mode/0, r_mode/0]).
1313

14-
-export([roots/0, fields/1, translations/0, translation/1]).
14+
-export([roots/0, fields/1, translations/0, translation/1, namespace/0]).
1515

16+
namespace() -> "auth_mongo".
1617
roots() -> ["auth"].
1718

1819
fields("auth") ->

sample-schemas/emqx_auth_mysql_schema.erl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44

55
-behaviour(hocon_schema).
66

7-
-export([roots/0, fields/1, translations/0, translation/1]).
7+
-export([roots/0, fields/1, translations/0, translation/1, namespace/0]).
88

99
roots() -> ["auth"].
1010

11+
namespace() -> "auth_mysql".
1112
fields("auth") ->
1213
[ {"mysql", emqx_schema:ref("mysql")}];
1314

sample-schemas/emqx_auth_pgsql_schema.erl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44

55
-behaviour(hocon_schema).
66

7-
-export([roots/0, fields/1, translations/0, translation/1]).
7+
-export([roots/0, fields/1, translations/0, translation/1, namespace/0]).
88

9+
namespace() -> "auth_pgsql".
910
roots() -> ["auth"].
1011

1112
fields("auth") ->

sample-schemas/emqx_auth_redis_schema.erl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44

55
-behaviour(hocon_schema).
66

7-
-export([roots/0, fields/1, translations/0, translation/1]).
7+
-export([roots/0, fields/1, translations/0, translation/1, namespace/0]).
88

9+
namespace() -> "auth_redis".
910
roots() -> ["auth"].
1011

1112
fields("auth") ->

sample-schemas/emqx_management_schema.erl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99

1010
-reflect_type([endpoint/0, verify/0]).
1111

12-
-export([roots/0, fields/1, translations/0, translation/1]).
12+
-export([roots/0, fields/1, translations/0, translation/1, namespace/0]).
1313

14+
namespace() -> "management".
1415
roots() -> ["management"].
1516

1617
fields("management") ->

0 commit comments

Comments
 (0)