Merge pull request #12115 from zmstone/1206-fix-dialyzer
1206 fix dialyzer
This commit is contained in:
commit
7e3ed05f87
|
@ -28,9 +28,9 @@
|
||||||
{gproc, {git, "https://github.com/emqx/gproc", {tag, "0.9.0.1"}}},
|
{gproc, {git, "https://github.com/emqx/gproc", {tag, "0.9.0.1"}}},
|
||||||
{cowboy, {git, "https://github.com/emqx/cowboy", {tag, "2.9.2"}}},
|
{cowboy, {git, "https://github.com/emqx/cowboy", {tag, "2.9.2"}}},
|
||||||
{esockd, {git, "https://github.com/emqx/esockd", {tag, "5.9.9"}}},
|
{esockd, {git, "https://github.com/emqx/esockd", {tag, "5.9.9"}}},
|
||||||
{ekka, {git, "https://github.com/emqx/ekka", {tag, "0.15.16"}}},
|
{ekka, {git, "https://github.com/emqx/ekka", {tag, "0.17.0"}}},
|
||||||
{gen_rpc, {git, "https://github.com/emqx/gen_rpc", {tag, "3.3.0"}}},
|
{gen_rpc, {git, "https://github.com/emqx/gen_rpc", {tag, "3.3.0"}}},
|
||||||
{hocon, {git, "https://github.com/emqx/hocon.git", {tag, "0.40.0"}}},
|
{hocon, {git, "https://github.com/emqx/hocon.git", {tag, "0.40.1"}}},
|
||||||
{emqx_http_lib, {git, "https://github.com/emqx/emqx_http_lib.git", {tag, "0.5.3"}}},
|
{emqx_http_lib, {git, "https://github.com/emqx/emqx_http_lib.git", {tag, "0.5.3"}}},
|
||||||
{pbkdf2, {git, "https://github.com/emqx/erlang-pbkdf2.git", {tag, "2.0.4"}}},
|
{pbkdf2, {git, "https://github.com/emqx/erlang-pbkdf2.git", {tag, "2.0.4"}}},
|
||||||
{recon, {git, "https://github.com/ferd/recon", {tag, "2.5.1"}}},
|
{recon, {git, "https://github.com/ferd/recon", {tag, "2.5.1"}}},
|
||||||
|
@ -45,7 +45,7 @@
|
||||||
{meck, "0.9.2"},
|
{meck, "0.9.2"},
|
||||||
{proper, "1.4.0"},
|
{proper, "1.4.0"},
|
||||||
{bbmustache, "1.10.0"},
|
{bbmustache, "1.10.0"},
|
||||||
{emqtt, {git, "https://github.com/emqx/emqtt", {tag, "1.9.7"}}}
|
{emqtt, {git, "https://github.com/emqx/emqtt", {tag, "1.10.0"}}}
|
||||||
]},
|
]},
|
||||||
{extra_src_dirs, [{"test", [recursive]},
|
{extra_src_dirs, [{"test", [recursive]},
|
||||||
{"integration_test", [recursive]}]}
|
{"integration_test", [recursive]}]}
|
||||||
|
|
|
@ -19,6 +19,6 @@
|
||||||
-callback import_config(RawConf :: map()) ->
|
-callback import_config(RawConf :: map()) ->
|
||||||
{ok, #{
|
{ok, #{
|
||||||
root_key => emqx_utils_maps:config_key(),
|
root_key => emqx_utils_maps:config_key(),
|
||||||
changed => [emqx_utils_maps:config_path()]
|
changed => [emqx_utils_maps:config_key_path()]
|
||||||
}}
|
}}
|
||||||
| {error, #{root_key => emqx_utils_maps:config_key(), reason => term()}}.
|
| {error, #{root_key => emqx_utils_maps:config_key(), reason => term()}}.
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
gproc,
|
gproc,
|
||||||
gen_rpc,
|
gen_rpc,
|
||||||
mria,
|
mria,
|
||||||
|
ekka,
|
||||||
esockd,
|
esockd,
|
||||||
cowboy,
|
cowboy,
|
||||||
sasl,
|
sasl,
|
||||||
|
|
|
@ -96,7 +96,7 @@
|
||||||
%% Authentication Data Cache
|
%% Authentication Data Cache
|
||||||
auth_cache :: maybe(map()),
|
auth_cache :: maybe(map()),
|
||||||
%% Quota checkers
|
%% Quota checkers
|
||||||
quota :: emqx_limiter_container:limiter(),
|
quota :: emqx_limiter_container:container(),
|
||||||
%% Timers
|
%% Timers
|
||||||
timers :: #{atom() => disabled | maybe(reference())},
|
timers :: #{atom() => disabled | maybe(reference())},
|
||||||
%% Conn State
|
%% Conn State
|
||||||
|
|
|
@ -23,9 +23,7 @@
|
||||||
|
|
||||||
-export([
|
-export([
|
||||||
trans/2,
|
trans/2,
|
||||||
trans/3,
|
|
||||||
lock/1,
|
lock/1,
|
||||||
lock/2,
|
|
||||||
unlock/1
|
unlock/1
|
||||||
]).
|
]).
|
||||||
|
|
||||||
|
@ -33,19 +31,14 @@
|
||||||
start_link() ->
|
start_link() ->
|
||||||
ekka_locker:start_link(?MODULE).
|
ekka_locker:start_link(?MODULE).
|
||||||
|
|
||||||
-spec trans(emqx_types:clientid(), fun(([node()]) -> any())) -> any().
|
|
||||||
trans(ClientId, Fun) ->
|
|
||||||
trans(ClientId, Fun, undefined).
|
|
||||||
|
|
||||||
-spec trans(
|
-spec trans(
|
||||||
maybe(emqx_types:clientid()),
|
maybe(emqx_types:clientid()),
|
||||||
fun(([node()]) -> any()),
|
fun(([node()]) -> any())
|
||||||
ekka_locker:piggyback()
|
|
||||||
) -> any().
|
) -> any().
|
||||||
trans(undefined, Fun, _Piggyback) ->
|
trans(undefined, Fun) ->
|
||||||
Fun([]);
|
Fun([]);
|
||||||
trans(ClientId, Fun, Piggyback) ->
|
trans(ClientId, Fun) ->
|
||||||
case lock(ClientId, Piggyback) of
|
case lock(ClientId) of
|
||||||
{true, Nodes} ->
|
{true, Nodes} ->
|
||||||
try
|
try
|
||||||
Fun(Nodes)
|
Fun(Nodes)
|
||||||
|
@ -56,14 +49,10 @@ trans(ClientId, Fun, Piggyback) ->
|
||||||
{error, client_id_unavailable}
|
{error, client_id_unavailable}
|
||||||
end.
|
end.
|
||||||
|
|
||||||
-spec lock(emqx_types:clientid()) -> ekka_locker:lock_result().
|
-spec lock(emqx_types:clientid()) -> {boolean(), [node() | {node(), any()}]}.
|
||||||
lock(ClientId) ->
|
lock(ClientId) ->
|
||||||
ekka_locker:acquire(?MODULE, ClientId, strategy()).
|
ekka_locker:acquire(?MODULE, ClientId, strategy()).
|
||||||
|
|
||||||
-spec lock(emqx_types:clientid(), ekka_locker:piggyback()) -> ekka_locker:lock_result().
|
|
||||||
lock(ClientId, Piggyback) ->
|
|
||||||
ekka_locker:acquire(?MODULE, ClientId, strategy(), Piggyback).
|
|
||||||
|
|
||||||
-spec unlock(emqx_types:clientid()) -> {boolean(), [node()]}.
|
-spec unlock(emqx_types:clientid()) -> {boolean(), [node()]}.
|
||||||
unlock(ClientId) ->
|
unlock(ClientId) ->
|
||||||
ekka_locker:release(?MODULE, ClientId, strategy()).
|
ekka_locker:release(?MODULE, ClientId, strategy()).
|
||||||
|
|
|
@ -84,6 +84,7 @@
|
||||||
ok | {ok, Result :: any()} | {error, Reason :: term()}.
|
ok | {ok, Result :: any()} | {error, Reason :: term()}.
|
||||||
|
|
||||||
-type state() :: #{handlers := any()}.
|
-type state() :: #{handlers := any()}.
|
||||||
|
-type config_key_path() :: emqx_utils_maps:config_key_path().
|
||||||
|
|
||||||
start_link() ->
|
start_link() ->
|
||||||
gen_server:start_link({local, ?MODULE}, ?MODULE, {}, []).
|
gen_server:start_link({local, ?MODULE}, ?MODULE, {}, []).
|
||||||
|
@ -91,21 +92,21 @@ start_link() ->
|
||||||
stop() ->
|
stop() ->
|
||||||
gen_server:stop(?MODULE).
|
gen_server:stop(?MODULE).
|
||||||
|
|
||||||
-spec update_config(module(), emqx_config:config_key_path(), emqx_config:update_args()) ->
|
-spec update_config(module(), config_key_path(), emqx_config:update_args()) ->
|
||||||
{ok, emqx_config:update_result()} | {error, emqx_config:update_error()}.
|
{ok, emqx_config:update_result()} | {error, emqx_config:update_error()}.
|
||||||
update_config(SchemaModule, ConfKeyPath, UpdateArgs) ->
|
update_config(SchemaModule, ConfKeyPath, UpdateArgs) ->
|
||||||
%% force convert the path to a list of atoms, as there maybe some wildcard names/ids in the path
|
%% force convert the path to a list of atoms, as there maybe some wildcard names/ids in the path
|
||||||
AtomKeyPath = [atom(Key) || Key <- ConfKeyPath],
|
AtomKeyPath = [atom(Key) || Key <- ConfKeyPath],
|
||||||
gen_server:call(?MODULE, {change_config, SchemaModule, AtomKeyPath, UpdateArgs}, infinity).
|
gen_server:call(?MODULE, {change_config, SchemaModule, AtomKeyPath, UpdateArgs}, infinity).
|
||||||
|
|
||||||
-spec add_handler(emqx_config:config_key_path(), handler_name()) ->
|
-spec add_handler(config_key_path(), handler_name()) ->
|
||||||
ok | {error, {conflict, list()}}.
|
ok | {error, {conflict, list()}}.
|
||||||
add_handler(ConfKeyPath, HandlerName) ->
|
add_handler(ConfKeyPath, HandlerName) ->
|
||||||
assert_callback_function(HandlerName),
|
assert_callback_function(HandlerName),
|
||||||
gen_server:call(?MODULE, {add_handler, ConfKeyPath, HandlerName}).
|
gen_server:call(?MODULE, {add_handler, ConfKeyPath, HandlerName}).
|
||||||
|
|
||||||
%% @doc Remove handler asynchronously
|
%% @doc Remove handler asynchronously
|
||||||
-spec remove_handler(emqx_config:config_key_path()) -> ok.
|
-spec remove_handler(config_key_path()) -> ok.
|
||||||
remove_handler(ConfKeyPath) ->
|
remove_handler(ConfKeyPath) ->
|
||||||
gen_server:cast(?MODULE, {remove_handler, ConfKeyPath}).
|
gen_server:cast(?MODULE, {remove_handler, ConfKeyPath}).
|
||||||
|
|
||||||
|
@ -764,7 +765,7 @@ assert_callback_function(Mod) ->
|
||||||
end,
|
end,
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
-spec schema(module(), emqx_utils_maps:config_key_path()) -> hocon_schema:schema().
|
-spec schema(module(), config_key_path()) -> hocon_schema:schema().
|
||||||
schema(SchemaModule, [RootKey | _]) ->
|
schema(SchemaModule, [RootKey | _]) ->
|
||||||
Roots = hocon_schema:roots(SchemaModule),
|
Roots = hocon_schema:roots(SchemaModule),
|
||||||
{Field, Translations} =
|
{Field, Translations} =
|
||||||
|
|
|
@ -58,12 +58,14 @@
|
||||||
-define(DEFAULT_CACHE_CAPACITY, 100).
|
-define(DEFAULT_CACHE_CAPACITY, 100).
|
||||||
-define(CONF_KEY_PATH, [crl_cache]).
|
-define(CONF_KEY_PATH, [crl_cache]).
|
||||||
|
|
||||||
|
-type duration() :: non_neg_integer().
|
||||||
|
|
||||||
-record(state, {
|
-record(state, {
|
||||||
refresh_timers = #{} :: #{binary() => timer:tref()},
|
refresh_timers = #{} :: #{binary() => reference()},
|
||||||
refresh_interval = timer:minutes(15) :: timer:time(),
|
refresh_interval = timer:minutes(15) :: duration(),
|
||||||
http_timeout = ?HTTP_TIMEOUT :: timer:time(),
|
http_timeout = ?HTTP_TIMEOUT :: duration(),
|
||||||
%% keeps track of URLs by insertion time
|
%% keeps track of URLs by insertion time
|
||||||
insertion_times = gb_trees:empty() :: gb_trees:tree(timer:time(), url()),
|
insertion_times = gb_trees:empty() :: gb_trees:tree(duration(), url()),
|
||||||
%% the set of cached URLs, for testing if an URL is already
|
%% the set of cached URLs, for testing if an URL is already
|
||||||
%% registered.
|
%% registered.
|
||||||
cached_urls = sets:new([{version, 2}]) :: sets:set(url()),
|
cached_urls = sets:new([{version, 2}]) :: sets:set(url()),
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
module := ?MODULE,
|
module := ?MODULE,
|
||||||
id := emqx_limiter_schema:limiter_id(),
|
id := emqx_limiter_schema:limiter_id(),
|
||||||
type := emqx_limiter_schema:limiter_type(),
|
type := emqx_limiter_schema:limiter_type(),
|
||||||
bucket := hocons:config()
|
bucket := hocon:config()
|
||||||
}.
|
}.
|
||||||
|
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
-spec new_create_options(
|
-spec new_create_options(
|
||||||
emqx_limiter_schema:limiter_id(),
|
emqx_limiter_schema:limiter_id(),
|
||||||
emqx_limiter_schema:limiter_type(),
|
emqx_limiter_schema:limiter_type(),
|
||||||
hocons:config()
|
hocon:config()
|
||||||
) -> create_options().
|
) -> create_options().
|
||||||
new_create_options(Id, Type, BucketCfg) ->
|
new_create_options(Id, Type, BucketCfg) ->
|
||||||
#{module => ?MODULE, id => Id, type => Type, bucket => BucketCfg}.
|
#{module => ?MODULE, id => Id, type => Type, bucket => BucketCfg}.
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
make_future/1,
|
make_future/1,
|
||||||
available/1
|
available/1
|
||||||
]).
|
]).
|
||||||
-export_type([local_limiter/0]).
|
-export_type([local_limiter/0, limiter/0]).
|
||||||
|
|
||||||
%% a token bucket limiter which may or not contains a reference to another limiter,
|
%% a token bucket limiter which may or not contains a reference to another limiter,
|
||||||
%% and can be used in a client alone
|
%% and can be used in a client alone
|
||||||
|
|
|
@ -70,7 +70,7 @@
|
||||||
-spec get_limiter_by_types(
|
-spec get_limiter_by_types(
|
||||||
limiter_id() | {atom(), atom()},
|
limiter_id() | {atom(), atom()},
|
||||||
list(limiter_type()),
|
list(limiter_type()),
|
||||||
#{limiter_type() => hocons:config()}
|
#{limiter_type() => hocon:config()}
|
||||||
) -> container().
|
) -> container().
|
||||||
get_limiter_by_types({Type, Listener}, Types, BucketCfgs) ->
|
get_limiter_by_types({Type, Listener}, Types, BucketCfgs) ->
|
||||||
Id = emqx_listeners:listener_id(Type, Listener),
|
Id = emqx_listeners:listener_id(Type, Listener),
|
||||||
|
|
|
@ -77,7 +77,7 @@
|
||||||
start_server(Type) ->
|
start_server(Type) ->
|
||||||
emqx_limiter_server_sup:start(Type).
|
emqx_limiter_server_sup:start(Type).
|
||||||
|
|
||||||
-spec start_server(limiter_type(), hocons:config()) -> _.
|
-spec start_server(limiter_type(), hocon:config()) -> _.
|
||||||
start_server(Type, Cfg) ->
|
start_server(Type, Cfg) ->
|
||||||
emqx_limiter_server_sup:start(Type, Cfg).
|
emqx_limiter_server_sup:start(Type, Cfg).
|
||||||
|
|
||||||
|
|
|
@ -112,7 +112,7 @@
|
||||||
-spec connect(
|
-spec connect(
|
||||||
limiter_id(),
|
limiter_id(),
|
||||||
limiter_type(),
|
limiter_type(),
|
||||||
hocons:config() | undefined
|
hocon:config() | undefined
|
||||||
) ->
|
) ->
|
||||||
{ok, emqx_htb_limiter:limiter()} | {error, _}.
|
{ok, emqx_htb_limiter:limiter()} | {error, _}.
|
||||||
%% undefined is the default situation, no limiter setting by default
|
%% undefined is the default situation, no limiter setting by default
|
||||||
|
@ -128,7 +128,7 @@ connect(Id, Type, Cfg) ->
|
||||||
maps:get(Type, Cfg, undefined)
|
maps:get(Type, Cfg, undefined)
|
||||||
).
|
).
|
||||||
|
|
||||||
-spec add_bucket(limiter_id(), limiter_type(), hocons:config() | undefined) -> ok.
|
-spec add_bucket(limiter_id(), limiter_type(), hocon:config() | undefined) -> ok.
|
||||||
add_bucket(_Id, _Type, undefined) ->
|
add_bucket(_Id, _Type, undefined) ->
|
||||||
ok;
|
ok;
|
||||||
%% a bucket with an infinity rate shouldn't be added to this server, because it is always full
|
%% a bucket with an infinity rate shouldn't be added to this server, because it is always full
|
||||||
|
@ -153,7 +153,7 @@ name(Type) ->
|
||||||
restart(Type) ->
|
restart(Type) ->
|
||||||
?CALL(Type).
|
?CALL(Type).
|
||||||
|
|
||||||
-spec update_config(limiter_type(), hocons:config()) -> ok | {error, _}.
|
-spec update_config(limiter_type(), hocon:config()) -> ok | {error, _}.
|
||||||
update_config(Type, Config) ->
|
update_config(Type, Config) ->
|
||||||
?CALL(Type, {update_config, Type, Config}).
|
?CALL(Type, {update_config, Type, Config}).
|
||||||
|
|
||||||
|
@ -166,7 +166,7 @@ whereis(Type) ->
|
||||||
%% Starts the server
|
%% Starts the server
|
||||||
%% @end
|
%% @end
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
-spec start_link(limiter_type(), hocons:config()) -> _.
|
-spec start_link(limiter_type(), hocon:config()) -> _.
|
||||||
start_link(Type, Cfg) ->
|
start_link(Type, Cfg) ->
|
||||||
gen_server:start_link({local, name(Type)}, ?MODULE, [Type, Cfg], []).
|
gen_server:start_link({local, name(Type)}, ?MODULE, [Type, Cfg], []).
|
||||||
|
|
||||||
|
@ -500,7 +500,7 @@ init_tree(Type, #{rate := Rate} = Cfg) ->
|
||||||
buckets => #{}
|
buckets => #{}
|
||||||
}.
|
}.
|
||||||
|
|
||||||
-spec make_root(hocons:confg()) -> root().
|
-spec make_root(hocon:config()) -> root().
|
||||||
make_root(#{rate := Rate, burst := Burst}) ->
|
make_root(#{rate := Rate, burst := Burst}) ->
|
||||||
#{
|
#{
|
||||||
rate => Rate,
|
rate => Rate,
|
||||||
|
@ -554,7 +554,7 @@ do_del_bucket(Id, #{type := Type, buckets := Buckets} = State) ->
|
||||||
State#{buckets := maps:remove(Id, Buckets)}
|
State#{buckets := maps:remove(Id, Buckets)}
|
||||||
end.
|
end.
|
||||||
|
|
||||||
-spec get_initial_val(hocons:config()) -> decimal().
|
-spec get_initial_val(hocon:config()) -> decimal().
|
||||||
get_initial_val(
|
get_initial_val(
|
||||||
#{
|
#{
|
||||||
initial := Initial,
|
initial := Initial,
|
||||||
|
|
|
@ -47,7 +47,7 @@ start(Type) ->
|
||||||
Spec = make_child(Type),
|
Spec = make_child(Type),
|
||||||
supervisor:start_child(?MODULE, Spec).
|
supervisor:start_child(?MODULE, Spec).
|
||||||
|
|
||||||
-spec start(emqx_limiter_schema:limiter_type(), hocons:config()) -> _.
|
-spec start(emqx_limiter_schema:limiter_type(), hocon:config()) -> _.
|
||||||
start(Type, Cfg) ->
|
start(Type, Cfg) ->
|
||||||
Spec = make_child(Type, Cfg),
|
Spec = make_child(Type, Cfg),
|
||||||
supervisor:start_child(?MODULE, Spec).
|
supervisor:start_child(?MODULE, Spec).
|
||||||
|
|
|
@ -3373,7 +3373,7 @@ naive_env_interpolation("$" ++ Maybe = Original) ->
|
||||||
filename:join([Path, Tail]);
|
filename:join([Path, Tail]);
|
||||||
error ->
|
error ->
|
||||||
?SLOG(warning, #{
|
?SLOG(warning, #{
|
||||||
msg => "failed_to_resolve_env_variable",
|
msg => "cannot_resolve_env_variable",
|
||||||
env => Env,
|
env => Env,
|
||||||
original => Original
|
original => Original
|
||||||
}),
|
}),
|
||||||
|
|
|
@ -114,7 +114,9 @@
|
||||||
reply/0,
|
reply/0,
|
||||||
replies/0,
|
replies/0,
|
||||||
common_timer_name/0,
|
common_timer_name/0,
|
||||||
custom_timer_name/0
|
custom_timer_name/0,
|
||||||
|
session_id/0,
|
||||||
|
session/0
|
||||||
]).
|
]).
|
||||||
|
|
||||||
-type session_id() :: _TODO.
|
-type session_id() :: _TODO.
|
||||||
|
@ -150,6 +152,8 @@
|
||||||
await_rel_timeout := timeout()
|
await_rel_timeout := timeout()
|
||||||
}.
|
}.
|
||||||
|
|
||||||
|
-type session() :: t().
|
||||||
|
|
||||||
-type t() ::
|
-type t() ::
|
||||||
emqx_session_mem:session()
|
emqx_session_mem:session()
|
||||||
| emqx_persistent_session_ds:session().
|
| emqx_persistent_session_ds:session().
|
||||||
|
|
|
@ -114,6 +114,8 @@
|
||||||
|
|
||||||
-export_type([takeover_data/0]).
|
-export_type([takeover_data/0]).
|
||||||
|
|
||||||
|
-export_type([startlink_ret/0]).
|
||||||
|
|
||||||
-type proto_ver() ::
|
-type proto_ver() ::
|
||||||
?MQTT_PROTO_V3
|
?MQTT_PROTO_V3
|
||||||
| ?MQTT_PROTO_V4
|
| ?MQTT_PROTO_V4
|
||||||
|
|
|
@ -35,7 +35,7 @@ t_start_link(_) ->
|
||||||
emqx_cm_locker:start_link().
|
emqx_cm_locker:start_link().
|
||||||
|
|
||||||
t_trans(_) ->
|
t_trans(_) ->
|
||||||
ok = emqx_cm_locker:trans(undefined, fun(_) -> ok end, []),
|
ok = emqx_cm_locker:trans(undefined, fun(_) -> ok end),
|
||||||
ok = emqx_cm_locker:trans(<<"clientid">>, fun(_) -> ok end).
|
ok = emqx_cm_locker:trans(<<"clientid">>, fun(_) -> ok end).
|
||||||
|
|
||||||
t_lock_unlock(_) ->
|
t_lock_unlock(_) ->
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
%% -*- mode: erlang -*-
|
%% -*- mode: erlang -*-
|
||||||
{application, emqx_auth, [
|
{application, emqx_auth, [
|
||||||
{description, "EMQX Authentication and authorization"},
|
{description, "EMQX Authentication and authorization"},
|
||||||
{vsn, "0.1.28"},
|
{vsn, "0.1.29"},
|
||||||
{modules, []},
|
{modules, []},
|
||||||
{registered, [emqx_auth_sup]},
|
{registered, [emqx_auth_sup]},
|
||||||
{applications, [
|
{applications, [
|
||||||
|
|
|
@ -21,7 +21,9 @@
|
||||||
-include("emqx_authn.hrl").
|
-include("emqx_authn.hrl").
|
||||||
-include("emqx_authn_chains.hrl").
|
-include("emqx_authn_chains.hrl").
|
||||||
|
|
||||||
|
-ifdef(TEST).
|
||||||
-include_lib("eunit/include/eunit.hrl").
|
-include_lib("eunit/include/eunit.hrl").
|
||||||
|
-endif.
|
||||||
|
|
||||||
-behaviour(emqx_schema_hooks).
|
-behaviour(emqx_schema_hooks).
|
||||||
-export([
|
-export([
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
%% -*- mode: erlang -*-
|
%% -*- mode: erlang -*-
|
||||||
{application, emqx_auto_subscribe, [
|
{application, emqx_auto_subscribe, [
|
||||||
{description, "Auto subscribe Application"},
|
{description, "Auto subscribe Application"},
|
||||||
{vsn, "0.1.5"},
|
{vsn, "0.1.6"},
|
||||||
{registered, []},
|
{registered, []},
|
||||||
{mod, {emqx_auto_subscribe_app, []}},
|
{mod, {emqx_auto_subscribe_app, []}},
|
||||||
{applications, [
|
{applications, [
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
-export([init/1]).
|
-export([init/1]).
|
||||||
|
|
||||||
-spec init(hocons:config()) -> {Module :: atom(), Config :: term()}.
|
-spec init(hocon:config()) -> {Module :: atom(), Config :: term()}.
|
||||||
init(Config) ->
|
init(Config) ->
|
||||||
do_init(Config).
|
do_init(Config).
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,10 @@
|
||||||
-include_lib("typerefl/include/types.hrl").
|
-include_lib("typerefl/include/types.hrl").
|
||||||
-include_lib("hocon/include/hoconsc.hrl").
|
-include_lib("hocon/include/hoconsc.hrl").
|
||||||
-include_lib("emqx/include/logger.hrl").
|
-include_lib("emqx/include/logger.hrl").
|
||||||
|
|
||||||
|
-ifdef(TEST).
|
||||||
-include_lib("eunit/include/eunit.hrl").
|
-include_lib("eunit/include/eunit.hrl").
|
||||||
|
-endif.
|
||||||
|
|
||||||
-import(hoconsc, [mk/2, ref/2]).
|
-import(hoconsc, [mk/2, ref/2]).
|
||||||
|
|
||||||
|
|
|
@ -88,7 +88,7 @@ keyspace(_) -> undefined.
|
||||||
|
|
||||||
callback_mode() -> async_if_possible.
|
callback_mode() -> async_if_possible.
|
||||||
|
|
||||||
-spec on_start(binary(), hoconsc:config()) -> {ok, state()} | {error, _}.
|
-spec on_start(binary(), hocon:config()) -> {ok, state()} | {error, _}.
|
||||||
on_start(
|
on_start(
|
||||||
InstId,
|
InstId,
|
||||||
#{
|
#{
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
|
|
||||||
-type service_account_json() :: emqx_bridge_gcp_pubsub:service_account_json().
|
-type service_account_json() :: emqx_bridge_gcp_pubsub:service_account_json().
|
||||||
-type project_id() :: binary().
|
-type project_id() :: binary().
|
||||||
|
-type duration() :: non_neg_integer().
|
||||||
-type config() :: #{
|
-type config() :: #{
|
||||||
connect_timeout := emqx_schema:duration_ms(),
|
connect_timeout := emqx_schema:duration_ms(),
|
||||||
max_retries := non_neg_integer(),
|
max_retries := non_neg_integer(),
|
||||||
|
@ -35,12 +36,12 @@
|
||||||
any() => term()
|
any() => term()
|
||||||
}.
|
}.
|
||||||
-opaque state() :: #{
|
-opaque state() :: #{
|
||||||
connect_timeout := timer:time(),
|
connect_timeout := duration(),
|
||||||
jwt_config := emqx_connector_jwt:jwt_config(),
|
jwt_config := emqx_connector_jwt:jwt_config(),
|
||||||
max_retries := non_neg_integer(),
|
max_retries := non_neg_integer(),
|
||||||
pool_name := binary(),
|
pool_name := binary(),
|
||||||
project_id := project_id(),
|
project_id := project_id(),
|
||||||
request_ttl := infinity | timer:time()
|
request_ttl := erlang:timeout()
|
||||||
}.
|
}.
|
||||||
-type headers() :: [{binary(), iodata()}].
|
-type headers() :: [{binary(), iodata()}].
|
||||||
-type body() :: iodata().
|
-type body() :: iodata().
|
||||||
|
@ -414,7 +415,7 @@ reply_delegator(ResourceId, ReplyFunAndArgs, Response) ->
|
||||||
Result = handle_response(Response, ResourceId, _QueryMode = async),
|
Result = handle_response(Response, ResourceId, _QueryMode = async),
|
||||||
emqx_resource:apply_reply_fun(ReplyFunAndArgs, Result).
|
emqx_resource:apply_reply_fun(ReplyFunAndArgs, Result).
|
||||||
|
|
||||||
-spec do_get_status(resource_id(), timer:time()) -> boolean().
|
-spec do_get_status(resource_id(), duration()) -> boolean().
|
||||||
do_get_status(ResourceId, Timeout) ->
|
do_get_status(ResourceId, Timeout) ->
|
||||||
Workers = [Worker || {_WorkerName, Worker} <- ehttpc:workers(ResourceId)],
|
Workers = [Worker || {_WorkerName, Worker} <- ehttpc:workers(ResourceId)],
|
||||||
DoPerWorker =
|
DoPerWorker =
|
||||||
|
|
|
@ -30,12 +30,13 @@
|
||||||
-type bridge_name() :: atom() | binary().
|
-type bridge_name() :: atom() | binary().
|
||||||
-type ack_id() :: binary().
|
-type ack_id() :: binary().
|
||||||
-type message_id() :: binary().
|
-type message_id() :: binary().
|
||||||
|
-type duration() :: non_neg_integer().
|
||||||
-type config() :: #{
|
-type config() :: #{
|
||||||
ack_deadline := emqx_schema:timeout_duration_s(),
|
ack_deadline := emqx_schema:timeout_duration_s(),
|
||||||
ack_retry_interval := emqx_schema:timeout_duration_ms(),
|
ack_retry_interval := emqx_schema:timeout_duration_ms(),
|
||||||
client := emqx_bridge_gcp_pubsub_client:state(),
|
client := emqx_bridge_gcp_pubsub_client:state(),
|
||||||
ecpool_worker_id => non_neg_integer(),
|
ecpool_worker_id => non_neg_integer(),
|
||||||
forget_interval := timer:time(),
|
forget_interval := duration(),
|
||||||
hookpoint := binary(),
|
hookpoint := binary(),
|
||||||
instance_id := binary(),
|
instance_id := binary(),
|
||||||
mqtt_config => emqx_bridge_gcp_pubsub_impl_consumer:mqtt_config(),
|
mqtt_config => emqx_bridge_gcp_pubsub_impl_consumer:mqtt_config(),
|
||||||
|
@ -52,7 +53,7 @@
|
||||||
async_workers := #{pid() => reference()},
|
async_workers := #{pid() => reference()},
|
||||||
client := emqx_bridge_gcp_pubsub_client:state(),
|
client := emqx_bridge_gcp_pubsub_client:state(),
|
||||||
ecpool_worker_id := non_neg_integer(),
|
ecpool_worker_id := non_neg_integer(),
|
||||||
forget_interval := timer:time(),
|
forget_interval := duration(),
|
||||||
hookpoint := binary(),
|
hookpoint := binary(),
|
||||||
instance_id := binary(),
|
instance_id := binary(),
|
||||||
mqtt_config := emqx_bridge_gcp_pubsub_impl_consumer:mqtt_config(),
|
mqtt_config := emqx_bridge_gcp_pubsub_impl_consumer:mqtt_config(),
|
||||||
|
|
|
@ -25,9 +25,11 @@
|
||||||
|
|
||||||
-include("emqx_bridge_syskeeper.hrl").
|
-include("emqx_bridge_syskeeper.hrl").
|
||||||
|
|
||||||
|
-type duration() :: non_neg_integer().
|
||||||
|
|
||||||
-type state() :: #{
|
-type state() :: #{
|
||||||
ack_mode := need_ack | no_ack,
|
ack_mode := need_ack | no_ack,
|
||||||
ack_timeout := timer:time(),
|
ack_timeout := duration(),
|
||||||
socket := undefined | inet:socket(),
|
socket := undefined | inet:socket(),
|
||||||
frame_state := emqx_bridge_syskeeper_frame:state(),
|
frame_state := emqx_bridge_syskeeper_frame:state(),
|
||||||
last_error := undefined | tuple()
|
last_error := undefined | tuple()
|
||||||
|
|
|
@ -33,8 +33,9 @@
|
||||||
-type jwt() :: binary().
|
-type jwt() :: binary().
|
||||||
-type wrapped_jwk() :: fun(() -> jose_jwk:key()).
|
-type wrapped_jwk() :: fun(() -> jose_jwk:key()).
|
||||||
-type jwk() :: jose_jwk:key().
|
-type jwk() :: jose_jwk:key().
|
||||||
|
-type duration() :: non_neg_integer().
|
||||||
-type jwt_config() :: #{
|
-type jwt_config() :: #{
|
||||||
expiration := timer:time(),
|
expiration := duration(),
|
||||||
resource_id := resource_id(),
|
resource_id := resource_id(),
|
||||||
table := ets:table(),
|
table := ets:table(),
|
||||||
jwk := wrapped_jwk() | jwk(),
|
jwk := wrapped_jwk() | jwk(),
|
||||||
|
|
|
@ -41,10 +41,12 @@
|
||||||
-include_lib("jose/include/jose_jwk.hrl").
|
-include_lib("jose/include/jose_jwk.hrl").
|
||||||
-include_lib("snabbkaffe/include/snabbkaffe.hrl").
|
-include_lib("snabbkaffe/include/snabbkaffe.hrl").
|
||||||
|
|
||||||
|
-type duration() :: non_neg_integer().
|
||||||
|
|
||||||
-type config() :: #{
|
-type config() :: #{
|
||||||
private_key := binary(),
|
private_key := binary(),
|
||||||
resource_id := resource_id(),
|
resource_id := resource_id(),
|
||||||
expiration := timer:time(),
|
expiration := duration(),
|
||||||
table := ets:table(),
|
table := ets:table(),
|
||||||
iss := binary(),
|
iss := binary(),
|
||||||
sub := binary(),
|
sub := binary(),
|
||||||
|
@ -54,9 +56,9 @@
|
||||||
}.
|
}.
|
||||||
-type jwt() :: binary().
|
-type jwt() :: binary().
|
||||||
-type state() :: #{
|
-type state() :: #{
|
||||||
refresh_timer := undefined | timer:tref() | reference(),
|
refresh_timer := undefined | reference(),
|
||||||
resource_id := resource_id(),
|
resource_id := resource_id(),
|
||||||
expiration := timer:time(),
|
expiration := duration(),
|
||||||
table := ets:table(),
|
table := ets:table(),
|
||||||
jwt := undefined | jwt(),
|
jwt := undefined | jwt(),
|
||||||
%% only undefined during startup
|
%% only undefined during startup
|
||||||
|
@ -221,7 +223,7 @@ censor_secret(undefined) ->
|
||||||
censor_secret(_Secret) ->
|
censor_secret(_Secret) ->
|
||||||
"******".
|
"******".
|
||||||
|
|
||||||
-spec cancel_timer(undefined | timer:tref() | reference()) -> ok.
|
-spec cancel_timer(undefined | reference() | reference()) -> ok.
|
||||||
cancel_timer(undefined) ->
|
cancel_timer(undefined) ->
|
||||||
ok;
|
ok;
|
||||||
cancel_timer(TRef) ->
|
cancel_timer(TRef) ->
|
||||||
|
|
|
@ -18,7 +18,10 @@
|
||||||
-include_lib("typerefl/include/types.hrl").
|
-include_lib("typerefl/include/types.hrl").
|
||||||
-include_lib("hocon/include/hoconsc.hrl").
|
-include_lib("hocon/include/hoconsc.hrl").
|
||||||
-include_lib("emqx/include/logger.hrl").
|
-include_lib("emqx/include/logger.hrl").
|
||||||
|
|
||||||
|
-ifdef(TEST).
|
||||||
-include_lib("eunit/include/eunit.hrl").
|
-include_lib("eunit/include/eunit.hrl").
|
||||||
|
-endif.
|
||||||
|
|
||||||
-import(hoconsc, [mk/2, ref/2]).
|
-import(hoconsc, [mk/2, ref/2]).
|
||||||
|
|
||||||
|
@ -557,6 +560,12 @@ to_bin(Bin) when is_binary(Bin) ->
|
||||||
to_bin(Something) ->
|
to_bin(Something) ->
|
||||||
Something.
|
Something.
|
||||||
|
|
||||||
|
node_name() ->
|
||||||
|
{"node", mk(binary(), #{desc => ?DESC("desc_node_name"), example => "emqx@127.0.0.1"})}.
|
||||||
|
|
||||||
|
status() ->
|
||||||
|
hoconsc:enum([connected, disconnected, connecting, inconsistent]).
|
||||||
|
|
||||||
-ifdef(TEST).
|
-ifdef(TEST).
|
||||||
-include_lib("hocon/include/hocon_types.hrl").
|
-include_lib("hocon/include/hocon_types.hrl").
|
||||||
schema_homogeneous_test() ->
|
schema_homogeneous_test() ->
|
||||||
|
@ -591,12 +600,6 @@ is_bad_schema(#{type := ?MAP(_, ?R_REF(Module, TypeName))}) ->
|
||||||
}}
|
}}
|
||||||
end.
|
end.
|
||||||
|
|
||||||
status() ->
|
|
||||||
hoconsc:enum([connected, disconnected, connecting, inconsistent]).
|
|
||||||
|
|
||||||
node_name() ->
|
|
||||||
{"node", mk(binary(), #{desc => ?DESC("desc_node_name"), example => "emqx@127.0.0.1"})}.
|
|
||||||
|
|
||||||
common_field_names() ->
|
common_field_names() ->
|
||||||
[
|
[
|
||||||
enable, description
|
enable, description
|
||||||
|
|
|
@ -30,6 +30,6 @@ evict_session_channel(Node, ClientId, ConnInfo, ClientInfo) ->
|
||||||
rpc:call(Node, emqx_eviction_agent, evict_session_channel, [ClientId, ConnInfo, ClientInfo]).
|
rpc:call(Node, emqx_eviction_agent, evict_session_channel, [ClientId, ConnInfo, ClientInfo]).
|
||||||
|
|
||||||
%% Introduced in v2:
|
%% Introduced in v2:
|
||||||
-spec all_channels_count([node()], time:time()) -> emqx_rpc:erpc_multicall(non_neg_integer()).
|
-spec all_channels_count([node()], timeout()) -> emqx_rpc:erpc_multicall(non_neg_integer()).
|
||||||
all_channels_count(Nodes, Timeout) ->
|
all_channels_count(Nodes, Timeout) ->
|
||||||
erpc:multicall(Nodes, emqx_eviction_agent, all_local_channels_count, [], Timeout).
|
erpc:multicall(Nodes, emqx_eviction_agent, all_local_channels_count, [], Timeout).
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
%% module if it integrated with emqx_gateway_conn module
|
%% module if it integrated with emqx_gateway_conn module
|
||||||
-module(emqx_gateway_channel).
|
-module(emqx_gateway_channel).
|
||||||
|
|
||||||
|
-export_type([gen_server_from/0]).
|
||||||
|
|
||||||
-type channel() :: any().
|
-type channel() :: any().
|
||||||
|
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
|
|
|
@ -16,6 +16,8 @@
|
||||||
|
|
||||||
-module(emqx_gateway_impl).
|
-module(emqx_gateway_impl).
|
||||||
|
|
||||||
|
-export_type([state/0]).
|
||||||
|
|
||||||
-include("emqx_gateway.hrl").
|
-include("emqx_gateway.hrl").
|
||||||
|
|
||||||
-type state() :: map().
|
-type state() :: map().
|
||||||
|
|
|
@ -96,8 +96,6 @@
|
||||||
-record(state, {
|
-record(state, {
|
||||||
%% Gateway Name
|
%% Gateway Name
|
||||||
gwname :: gateway_name(),
|
gwname :: gateway_name(),
|
||||||
%% ClientId Locker for CM
|
|
||||||
locker :: pid(),
|
|
||||||
%% ClientId Registry server
|
%% ClientId Registry server
|
||||||
registry :: pid(),
|
registry :: pid(),
|
||||||
chan_pmon :: emqx_pmon:pmon()
|
chan_pmon :: emqx_pmon:pmon()
|
||||||
|
@ -776,7 +774,7 @@ init(Options) ->
|
||||||
{ok, Registry} = emqx_gateway_cm_registry:start_link(GwName),
|
{ok, Registry} = emqx_gateway_cm_registry:start_link(GwName),
|
||||||
|
|
||||||
%% Start locker process
|
%% Start locker process
|
||||||
{ok, Locker} = ekka_locker:start_link(lockername(GwName)),
|
{ok, _LockerPid} = ekka_locker:start_link(lockername(GwName)),
|
||||||
|
|
||||||
%% Interval update stats
|
%% Interval update stats
|
||||||
%% TODO: v0.2
|
%% TODO: v0.2
|
||||||
|
@ -784,7 +782,6 @@ init(Options) ->
|
||||||
|
|
||||||
{ok, #state{
|
{ok, #state{
|
||||||
gwname = GwName,
|
gwname = GwName,
|
||||||
locker = Locker,
|
|
||||||
registry = Registry,
|
registry = Registry,
|
||||||
chan_pmon = emqx_pmon:new()
|
chan_pmon = emqx_pmon:new()
|
||||||
}}.
|
}}.
|
||||||
|
@ -812,9 +809,9 @@ handle_info(
|
||||||
handle_info(_Info, State) ->
|
handle_info(_Info, State) ->
|
||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|
||||||
terminate(_Reason, #state{registry = Registry, locker = Locker}) ->
|
terminate(_Reason, #state{registry = Registry, gwname = GwName}) ->
|
||||||
_ = gen_server:stop(Registry),
|
_ = gen_server:stop(Registry),
|
||||||
_ = ekka_locker:stop(Locker),
|
_ = ekka_locker:stop(lockername(GwName)),
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
code_change(_OldVsn, State, _Extra) ->
|
code_change(_OldVsn, State, _Extra) ->
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
-record(channel, {chid, pid}).
|
-record(channel, {chid, pid}).
|
||||||
|
|
||||||
%% @doc Start the global channel registry for the given gateway name.
|
%% @doc Start the global channel registry for the given gateway name.
|
||||||
-spec start_link(gateway_name()) -> gen_server:startlink_ret().
|
-spec start_link(gateway_name()) -> emqx_types:startlink_ret().
|
||||||
start_link(Name) ->
|
start_link(Name) ->
|
||||||
gen_server:start_link(?MODULE, [Name], []).
|
gen_server:start_link(?MODULE, [Name], []).
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
%% @doc The gateway instance context
|
%% @doc The gateway instance context
|
||||||
-module(emqx_gateway_ctx).
|
-module(emqx_gateway_ctx).
|
||||||
|
|
||||||
|
-export_type([context/0]).
|
||||||
|
|
||||||
-include("emqx_gateway.hrl").
|
-include("emqx_gateway.hrl").
|
||||||
|
|
||||||
%% @doc The running context for a Connection/Channel process.
|
%% @doc The running context for a Connection/Channel process.
|
||||||
|
|
|
@ -89,17 +89,17 @@
|
||||||
|
|
||||||
-elvis([{elvis_style, god_modules, disable}]).
|
-elvis([{elvis_style, god_modules, disable}]).
|
||||||
|
|
||||||
-spec childspec(supervisor:worker(), Mod :: atom()) ->
|
-spec childspec(worker | supervisor, Mod :: atom()) ->
|
||||||
supervisor:child_spec().
|
supervisor:child_spec().
|
||||||
childspec(Type, Mod) ->
|
childspec(Type, Mod) ->
|
||||||
childspec(Mod, Type, Mod, []).
|
childspec(Mod, Type, Mod, []).
|
||||||
|
|
||||||
-spec childspec(supervisor:worker(), Mod :: atom(), Args :: list()) ->
|
-spec childspec(worker | supervisor, Mod :: atom(), Args :: list()) ->
|
||||||
supervisor:child_spec().
|
supervisor:child_spec().
|
||||||
childspec(Type, Mod, Args) ->
|
childspec(Type, Mod, Args) ->
|
||||||
childspec(Mod, Type, Mod, Args).
|
childspec(Mod, Type, Mod, Args).
|
||||||
|
|
||||||
-spec childspec(atom(), supervisor:worker(), Mod :: atom(), Args :: list()) ->
|
-spec childspec(atom(), worker | supervisor, Mod :: atom(), Args :: list()) ->
|
||||||
supervisor:child_spec().
|
supervisor:child_spec().
|
||||||
childspec(Id, Type, Mod, Args) ->
|
childspec(Id, Type, Mod, Args) ->
|
||||||
#{
|
#{
|
||||||
|
@ -121,7 +121,7 @@ supervisor_ret({error, {Reason, Child}}) ->
|
||||||
supervisor_ret(Ret) ->
|
supervisor_ret(Ret) ->
|
||||||
Ret.
|
Ret.
|
||||||
|
|
||||||
-spec find_sup_child(Sup :: pid() | atom(), ChildId :: supervisor:child_id()) ->
|
-spec find_sup_child(Sup :: pid() | atom(), ChildId :: term()) ->
|
||||||
false
|
false
|
||||||
| {ok, pid()}.
|
| {ok, pid()}.
|
||||||
find_sup_child(Sup, ChildId) ->
|
find_sup_child(Sup, ChildId) ->
|
||||||
|
|
|
@ -40,7 +40,7 @@ introduced_in() ->
|
||||||
"5.0.0".
|
"5.0.0".
|
||||||
|
|
||||||
-spec lookup_by_clientid([node()], emqx_gateway_cm:gateway_name(), emqx_types:clientid()) ->
|
-spec lookup_by_clientid([node()], emqx_gateway_cm:gateway_name(), emqx_types:clientid()) ->
|
||||||
emqx_rpc:multicall_return([pid()]).
|
emqx_rpc:multicall_result([pid()]).
|
||||||
lookup_by_clientid(Nodes, GwName, ClientId) ->
|
lookup_by_clientid(Nodes, GwName, ClientId) ->
|
||||||
rpc:multicall(Nodes, emqx_gateway_cm, do_lookup_by_clientid, [GwName, ClientId]).
|
rpc:multicall(Nodes, emqx_gateway_cm, do_lookup_by_clientid, [GwName, ClientId]).
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
token :: token() | undefined,
|
token :: token() | undefined,
|
||||||
observe :: 0 | 1 | undefined | observed,
|
observe :: 0 | 1 | undefined | observed,
|
||||||
state :: atom(),
|
state :: atom(),
|
||||||
timers :: maps:map(),
|
timers :: map(),
|
||||||
transport :: emqx_coap_transport:transport()
|
transport :: emqx_coap_transport:transport()
|
||||||
}).
|
}).
|
||||||
-type state_machine() :: #state_machine{}.
|
-type state_machine() :: #state_machine{}.
|
||||||
|
|
|
@ -131,7 +131,7 @@ stats(#channel{subscriptions = Subs}) ->
|
||||||
%% Init the channel
|
%% Init the channel
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
|
|
||||||
-spec init(emqx_exproto_types:conninfo(), map()) -> channel().
|
-spec init(emqx_types:conninfo(), map()) -> channel().
|
||||||
init(
|
init(
|
||||||
ConnInfo = #{
|
ConnInfo = #{
|
||||||
socktype := Socktype,
|
socktype := Socktype,
|
||||||
|
|
|
@ -29,6 +29,8 @@
|
||||||
is_empty/1
|
is_empty/1
|
||||||
]).
|
]).
|
||||||
|
|
||||||
|
-export_type([grpc_client_state/0]).
|
||||||
|
|
||||||
-define(CONN_HANDLER_MOD, emqx_exproto_v_1_connection_handler_client).
|
-define(CONN_HANDLER_MOD, emqx_exproto_v_1_connection_handler_client).
|
||||||
-define(CONN_UNARY_HANDLER_MOD, emqx_exproto_v_1_connection_unary_handler_client).
|
-define(CONN_UNARY_HANDLER_MOD, emqx_exproto_v_1_connection_unary_handler_client).
|
||||||
|
|
||||||
|
|
|
@ -38,13 +38,18 @@
|
||||||
unsubscribe/2
|
unsubscribe/2
|
||||||
]).
|
]).
|
||||||
|
|
||||||
|
%% TODO:
|
||||||
|
%% The spec should be :: grpc_cowboy_h:error_response()
|
||||||
|
%% But there is no such module as grpc_cowboy_h
|
||||||
|
-type error_response() :: term().
|
||||||
|
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
%% gRPC ConnectionAdapter service
|
%% gRPC ConnectionAdapter service
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
|
|
||||||
-spec send(emqx_exproto_pb:send_bytes_request(), grpc:metadata()) ->
|
-spec send(emqx_exproto_pb:send_bytes_request(), grpc:metadata()) ->
|
||||||
{ok, emqx_exproto_pb:code_response(), grpc:metadata()}
|
{ok, emqx_exproto_pb:code_response(), grpc:metadata()}
|
||||||
| {error, grpc_cowboy_h:error_response()}.
|
| {error, error_response()}.
|
||||||
send(Req = #{conn := Conn, bytes := Bytes}, Md) ->
|
send(Req = #{conn := Conn, bytes := Bytes}, Md) ->
|
||||||
?SLOG(debug, #{
|
?SLOG(debug, #{
|
||||||
msg => "recv_grpc_function_call",
|
msg => "recv_grpc_function_call",
|
||||||
|
@ -55,7 +60,7 @@ send(Req = #{conn := Conn, bytes := Bytes}, Md) ->
|
||||||
|
|
||||||
-spec close(emqx_exproto_pb:close_socket_request(), grpc:metadata()) ->
|
-spec close(emqx_exproto_pb:close_socket_request(), grpc:metadata()) ->
|
||||||
{ok, emqx_exproto_pb:code_response(), grpc:metadata()}
|
{ok, emqx_exproto_pb:code_response(), grpc:metadata()}
|
||||||
| {error, grpc_cowboy_h:error_response()}.
|
| {error, error_response()}.
|
||||||
close(Req = #{conn := Conn}, Md) ->
|
close(Req = #{conn := Conn}, Md) ->
|
||||||
?SLOG(debug, #{
|
?SLOG(debug, #{
|
||||||
msg => "recv_grpc_function_call",
|
msg => "recv_grpc_function_call",
|
||||||
|
@ -66,7 +71,7 @@ close(Req = #{conn := Conn}, Md) ->
|
||||||
|
|
||||||
-spec authenticate(emqx_exproto_pb:authenticate_request(), grpc:metadata()) ->
|
-spec authenticate(emqx_exproto_pb:authenticate_request(), grpc:metadata()) ->
|
||||||
{ok, emqx_exproto_pb:code_response(), grpc:metadata()}
|
{ok, emqx_exproto_pb:code_response(), grpc:metadata()}
|
||||||
| {error, grpc_cowboy_h:error_response()}.
|
| {error, error_response()}.
|
||||||
authenticate(
|
authenticate(
|
||||||
Req = #{
|
Req = #{
|
||||||
conn := Conn,
|
conn := Conn,
|
||||||
|
@ -89,7 +94,7 @@ authenticate(
|
||||||
|
|
||||||
-spec start_timer(emqx_exproto_pb:timer_request(), grpc:metadata()) ->
|
-spec start_timer(emqx_exproto_pb:timer_request(), grpc:metadata()) ->
|
||||||
{ok, emqx_exproto_pb:code_response(), grpc:metadata()}
|
{ok, emqx_exproto_pb:code_response(), grpc:metadata()}
|
||||||
| {error, grpc_cowboy_h:error_response()}.
|
| {error, error_response()}.
|
||||||
start_timer(Req = #{conn := Conn, type := Type, interval := Interval}, Md) when
|
start_timer(Req = #{conn := Conn, type := Type, interval := Interval}, Md) when
|
||||||
Type =:= 'KEEPALIVE' andalso Interval > 0
|
Type =:= 'KEEPALIVE' andalso Interval > 0
|
||||||
->
|
->
|
||||||
|
@ -111,7 +116,7 @@ start_timer(Req, Md) ->
|
||||||
|
|
||||||
-spec publish(emqx_exproto_pb:publish_request(), grpc:metadata()) ->
|
-spec publish(emqx_exproto_pb:publish_request(), grpc:metadata()) ->
|
||||||
{ok, emqx_exproto_pb:code_response(), grpc:metadata()}
|
{ok, emqx_exproto_pb:code_response(), grpc:metadata()}
|
||||||
| {error, grpc_cowboy_h:error_response()}.
|
| {error, error_response()}.
|
||||||
publish(Req = #{conn := Conn, topic := Topic, qos := Qos, payload := Payload}, Md) when
|
publish(Req = #{conn := Conn, topic := Topic, qos := Qos, payload := Payload}, Md) when
|
||||||
?IS_QOS(Qos)
|
?IS_QOS(Qos)
|
||||||
->
|
->
|
||||||
|
@ -132,7 +137,7 @@ publish(Req, Md) ->
|
||||||
|
|
||||||
-spec raw_publish(emqx_exproto_pb:raw_publish_request(), grpc:metadata()) ->
|
-spec raw_publish(emqx_exproto_pb:raw_publish_request(), grpc:metadata()) ->
|
||||||
{ok, emqx_exproto_pb:code_response(), grpc:metadata()}
|
{ok, emqx_exproto_pb:code_response(), grpc:metadata()}
|
||||||
| {error, grpc_stream:error_response()}.
|
| {error, error_response()}.
|
||||||
raw_publish(Req = #{topic := Topic, qos := Qos, payload := Payload}, Md) ->
|
raw_publish(Req = #{topic := Topic, qos := Qos, payload := Payload}, Md) ->
|
||||||
?SLOG(debug, #{
|
?SLOG(debug, #{
|
||||||
msg => "recv_grpc_function_call",
|
msg => "recv_grpc_function_call",
|
||||||
|
@ -145,7 +150,7 @@ raw_publish(Req = #{topic := Topic, qos := Qos, payload := Payload}, Md) ->
|
||||||
|
|
||||||
-spec subscribe(emqx_exproto_pb:subscribe_request(), grpc:metadata()) ->
|
-spec subscribe(emqx_exproto_pb:subscribe_request(), grpc:metadata()) ->
|
||||||
{ok, emqx_exproto_pb:code_response(), grpc:metadata()}
|
{ok, emqx_exproto_pb:code_response(), grpc:metadata()}
|
||||||
| {error, grpc_cowboy_h:error_response()}.
|
| {error, error_response()}.
|
||||||
subscribe(Req = #{conn := Conn, topic := Topic, qos := Qos}, Md) when
|
subscribe(Req = #{conn := Conn, topic := Topic, qos := Qos}, Md) when
|
||||||
?IS_QOS(Qos)
|
?IS_QOS(Qos)
|
||||||
->
|
->
|
||||||
|
@ -165,7 +170,7 @@ subscribe(Req, Md) ->
|
||||||
|
|
||||||
-spec unsubscribe(emqx_exproto_pb:unsubscribe_request(), grpc:metadata()) ->
|
-spec unsubscribe(emqx_exproto_pb:unsubscribe_request(), grpc:metadata()) ->
|
||||||
{ok, emqx_exproto_pb:code_response(), grpc:metadata()}
|
{ok, emqx_exproto_pb:code_response(), grpc:metadata()}
|
||||||
| {error, grpc_cowboy_h:error_response()}.
|
| {error, error_response()}.
|
||||||
unsubscribe(Req = #{conn := Conn, topic := Topic}, Md) ->
|
unsubscribe(Req = #{conn := Conn, topic := Topic}, Md) ->
|
||||||
?SLOG(debug, #{
|
?SLOG(debug, #{
|
||||||
msg => "recv_grpc_function_call",
|
msg => "recv_grpc_function_call",
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
%% -*- mode: erlang -*-
|
%% -*- mode: erlang -*-
|
||||||
{application, emqx_gateway_exproto, [
|
{application, emqx_gateway_exproto, [
|
||||||
{description, "ExProto Gateway"},
|
{description, "ExProto Gateway"},
|
||||||
{vsn, "0.1.5"},
|
{vsn, "0.1.6"},
|
||||||
{registered, []},
|
{registered, []},
|
||||||
{applications, [kernel, stdlib, grpc, emqx, emqx_gateway]},
|
{applications, [kernel, stdlib, grpc, emqx, emqx_gateway]},
|
||||||
{env, []},
|
{env, []},
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
{description, "LwM2M Gateway"},
|
{description, "LwM2M Gateway"},
|
||||||
{vsn, "0.1.5"},
|
{vsn, "0.1.5"},
|
||||||
{registered, []},
|
{registered, []},
|
||||||
{applications, [kernel, stdlib, emqx, emqx_gateway, emqx_gateway_coap]},
|
{applications, [kernel, stdlib, emqx, emqx_gateway, emqx_gateway_coap, xmerl]},
|
||||||
{env, []},
|
{env, []},
|
||||||
{modules, []},
|
{modules, []},
|
||||||
{licenses, ["Apache 2.0"]},
|
{licenses, ["Apache 2.0"]},
|
||||||
|
|
|
@ -43,6 +43,8 @@
|
||||||
-define(LWM2M_OBJECT_DEF_TAB, lwm2m_object_def_tab).
|
-define(LWM2M_OBJECT_DEF_TAB, lwm2m_object_def_tab).
|
||||||
-define(LWM2M_OBJECT_NAME_TO_ID_TAB, lwm2m_object_name_to_id_tab).
|
-define(LWM2M_OBJECT_NAME_TO_ID_TAB, lwm2m_object_name_to_id_tab).
|
||||||
|
|
||||||
|
-type xmlElement() :: tuple().
|
||||||
|
|
||||||
-record(state, {}).
|
-record(state, {}).
|
||||||
|
|
||||||
-elvis([{elvis_style, atom_naming_convention, disable}]).
|
-elvis([{elvis_style, atom_naming_convention, disable}]).
|
||||||
|
@ -59,7 +61,7 @@
|
||||||
start_link(XmlDir) ->
|
start_link(XmlDir) ->
|
||||||
gen_server:start_link({local, ?MODULE}, ?MODULE, [XmlDir], []).
|
gen_server:start_link({local, ?MODULE}, ?MODULE, [XmlDir], []).
|
||||||
|
|
||||||
-spec find_objectid(integer()) -> {error, no_xml_definition} | xmerl:xmlElement().
|
-spec find_objectid(integer()) -> {error, no_xml_definition} | xmlElement().
|
||||||
find_objectid(ObjectId) ->
|
find_objectid(ObjectId) ->
|
||||||
ObjectIdInt =
|
ObjectIdInt =
|
||||||
case is_list(ObjectId) of
|
case is_list(ObjectId) of
|
||||||
|
@ -71,7 +73,7 @@ find_objectid(ObjectId) ->
|
||||||
[{_ObjectId, Xml}] -> Xml
|
[{_ObjectId, Xml}] -> Xml
|
||||||
end.
|
end.
|
||||||
|
|
||||||
-spec find_name(string()) -> {error, no_xml_definition} | xmerl:xmlElement().
|
-spec find_name(string()) -> {error, no_xml_definition} | xmlElement().
|
||||||
find_name(Name) ->
|
find_name(Name) ->
|
||||||
NameBinary =
|
NameBinary =
|
||||||
case is_list(Name) of
|
case is_list(Name) of
|
||||||
|
|
|
@ -32,6 +32,8 @@
|
||||||
lookup_topic_id/2
|
lookup_topic_id/2
|
||||||
]).
|
]).
|
||||||
|
|
||||||
|
-export_type([registry/0]).
|
||||||
|
|
||||||
-define(PKEY(Id), {mqttsn, predef_topics, Id}).
|
-define(PKEY(Id), {mqttsn, predef_topics, Id}).
|
||||||
|
|
||||||
-type registry() :: #{
|
-type registry() :: #{
|
||||||
|
|
|
@ -72,13 +72,13 @@
|
||||||
%% Piggyback
|
%% Piggyback
|
||||||
piggyback :: single | multiple,
|
piggyback :: single | multiple,
|
||||||
%% Limiter
|
%% Limiter
|
||||||
limiter :: maybe(emqx_limiter:limiter()),
|
limiter :: maybe(emqx_htb_limiter:limiter()),
|
||||||
%% Limit Timer
|
%% Limit Timer
|
||||||
limit_timer :: maybe(reference()),
|
limit_timer :: maybe(reference()),
|
||||||
%% Parse State
|
%% Parse State
|
||||||
parse_state :: emqx_ocpp_frame:parse_state(),
|
parse_state :: emqx_ocpp_frame:parse_state(),
|
||||||
%% Serialize options
|
%% Serialize options
|
||||||
serialize :: emqx_ocpp_frame:serialize_opts(),
|
serialize :: emqx_ocpp_frame:serialize_options(),
|
||||||
%% Channel
|
%% Channel
|
||||||
channel :: emqx_ocpp_channel:channel(),
|
channel :: emqx_ocpp_channel:channel(),
|
||||||
%% GC State
|
%% GC State
|
||||||
|
@ -268,7 +268,7 @@ init_state_and_channel([Req, Opts, _WsOpts], _State = undefined) ->
|
||||||
ws_cookie => WsCookie,
|
ws_cookie => WsCookie,
|
||||||
conn_mod => ?MODULE
|
conn_mod => ?MODULE
|
||||||
},
|
},
|
||||||
Limiter = undeined,
|
Limiter = undefined,
|
||||||
ActiveN = emqx_gateway_utils:active_n(Opts),
|
ActiveN = emqx_gateway_utils:active_n(Opts),
|
||||||
Piggyback = emqx_utils_maps:deep_get([websocket, piggyback], Opts, multiple),
|
Piggyback = emqx_utils_maps:deep_get([websocket, piggyback], Opts, multiple),
|
||||||
ParseState = emqx_ocpp_frame:initial_parse_state(#{}),
|
ParseState = emqx_ocpp_frame:initial_parse_state(#{}),
|
||||||
|
|
|
@ -39,9 +39,12 @@
|
||||||
-export_type([
|
-export_type([
|
||||||
parse_state/0,
|
parse_state/0,
|
||||||
parse_result/0,
|
parse_result/0,
|
||||||
frame/0
|
frame/0,
|
||||||
|
serialize_options/0
|
||||||
]).
|
]).
|
||||||
|
|
||||||
|
-type serialize_options() :: emqx_gateway_frame:serialize_options().
|
||||||
|
|
||||||
-dialyzer({nowarn_function, [format/1]}).
|
-dialyzer({nowarn_function, [format/1]}).
|
||||||
|
|
||||||
-spec initial_parse_state(map()) -> parse_state().
|
-spec initial_parse_state(map()) -> parse_state().
|
||||||
|
@ -114,7 +117,7 @@ parse(
|
||||||
},
|
},
|
||||||
<<>>, Parser}.
|
<<>>, Parser}.
|
||||||
|
|
||||||
-spec serialize_opts() -> emqx_gateway_frame:serialize_options().
|
-spec serialize_opts() -> serialize_options().
|
||||||
serialize_opts() ->
|
serialize_opts() ->
|
||||||
#{}.
|
#{}.
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@
|
||||||
%% Channel State
|
%% Channel State
|
||||||
conn_state :: conn_state(),
|
conn_state :: conn_state(),
|
||||||
%% Heartbeat
|
%% Heartbeat
|
||||||
heartbeat :: emqx_stomp_heartbeat:heartbeat(),
|
heartbeat :: undefined | emqx_stomp_heartbeat:heartbeat(),
|
||||||
%% Subscriptions
|
%% Subscriptions
|
||||||
subscriptions = [],
|
subscriptions = [],
|
||||||
%% Timer
|
%% Timer
|
||||||
|
|
|
@ -27,6 +27,8 @@
|
||||||
interval/2
|
interval/2
|
||||||
]).
|
]).
|
||||||
|
|
||||||
|
-export_type([heartbeat/0]).
|
||||||
|
|
||||||
-record(heartbeater, {interval, statval, repeat}).
|
-record(heartbeater, {interval, statval, repeat}).
|
||||||
|
|
||||||
-type name() :: incoming | outgoing.
|
-type name() :: incoming | outgoing.
|
||||||
|
|
|
@ -130,7 +130,7 @@ ensure_username(Field) ->
|
||||||
%% ===================================================================
|
%% ===================================================================
|
||||||
callback_mode() -> always_sync.
|
callback_mode() -> always_sync.
|
||||||
|
|
||||||
-spec on_start(binary(), hoconsc:config()) -> {ok, state()} | {error, _}.
|
-spec on_start(binary(), hocon:config()) -> {ok, state()} | {error, _}.
|
||||||
on_start(
|
on_start(
|
||||||
InstId,
|
InstId,
|
||||||
#{
|
#{
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
-define(POOL_NAME_SUFFIX, "bind_worker").
|
-define(POOL_NAME_SUFFIX, "bind_worker").
|
||||||
|
|
||||||
%% ===================================================================
|
%% ===================================================================
|
||||||
-spec on_start(binary(), hoconsc:config(), proplists:proplist(), map()) ->
|
-spec on_start(binary(), hocon:config(), proplists:proplist(), map()) ->
|
||||||
{ok, binary(), map()} | {error, _}.
|
{ok, binary(), map()} | {error, _}.
|
||||||
on_start(InstId, #{method := #{bind_password := _}} = Config, Options, State) ->
|
on_start(InstId, #{method := #{bind_password := _}} = Config, Options, State) ->
|
||||||
PoolName = pool_name(InstId),
|
PoolName = pool_name(InstId),
|
||||||
|
|
|
@ -24,8 +24,15 @@
|
||||||
runtime_tools,
|
runtime_tools,
|
||||||
redbug,
|
redbug,
|
||||||
xmerl,
|
xmerl,
|
||||||
|
%% has no application/2 callback
|
||||||
{hocon, load},
|
{hocon, load},
|
||||||
telemetry
|
telemetry,
|
||||||
|
observer_cli,
|
||||||
|
covertool,
|
||||||
|
tools,
|
||||||
|
observer,
|
||||||
|
{system_monitor, load},
|
||||||
|
jq
|
||||||
],
|
],
|
||||||
%% must always be of type `load'
|
%% must always be of type `load'
|
||||||
common_business_apps =>
|
common_business_apps =>
|
||||||
|
@ -33,11 +40,6 @@
|
||||||
emqx,
|
emqx,
|
||||||
emqx_conf,
|
emqx_conf,
|
||||||
esasl,
|
esasl,
|
||||||
observer_cli,
|
|
||||||
tools,
|
|
||||||
covertool,
|
|
||||||
%% started by emqx_machine
|
|
||||||
system_monitor,
|
|
||||||
emqx_utils,
|
emqx_utils,
|
||||||
emqx_durable_storage,
|
emqx_durable_storage,
|
||||||
emqx_http_lib,
|
emqx_http_lib,
|
||||||
|
@ -79,9 +81,7 @@
|
||||||
emqx_plugins,
|
emqx_plugins,
|
||||||
emqx_opentelemetry,
|
emqx_opentelemetry,
|
||||||
quicer,
|
quicer,
|
||||||
bcrypt,
|
bcrypt
|
||||||
jq,
|
|
||||||
observer
|
|
||||||
],
|
],
|
||||||
%% must always be of type `load'
|
%% must always be of type `load'
|
||||||
ee_business_apps =>
|
ee_business_apps =>
|
||||||
|
|
|
@ -43,7 +43,8 @@
|
||||||
start_link() ->
|
start_link() ->
|
||||||
gen_server:start_link({local, ?MODULE}, ?MODULE, [], []).
|
gen_server:start_link({local, ?MODULE}, ?MODULE, [], []).
|
||||||
|
|
||||||
-spec run() -> {ok, timer:time()}.
|
%% @doc Run global garbage collection and return the time (in milliseconds) spent.
|
||||||
|
-spec run() -> {ok, non_neg_integer()}.
|
||||||
run() -> gen_server:call(?MODULE, run, infinity).
|
run() -> gen_server:call(?MODULE, run, infinity).
|
||||||
|
|
||||||
-spec stop() -> ok.
|
-spec stop() -> ok.
|
||||||
|
|
|
@ -6,7 +6,13 @@
|
||||||
{vsn, "0.2.17"},
|
{vsn, "0.2.17"},
|
||||||
{modules, []},
|
{modules, []},
|
||||||
{registered, []},
|
{registered, []},
|
||||||
{applications, [kernel, stdlib, emqx_ctl]},
|
{applications, [kernel, stdlib, emqx_ctl, covertool]},
|
||||||
|
%% system_monitor is loaded but not booted,
|
||||||
|
%% emqx_machine.erl makes the decision when to start
|
||||||
|
%% the app after certain config injection.
|
||||||
|
%% it's a included_application because otherwise dialyzer
|
||||||
|
%% would report unknown functions
|
||||||
|
{included_applications, [system_monitor]},
|
||||||
{mod, {emqx_machine_app, []}},
|
{mod, {emqx_machine_app, []}},
|
||||||
{env, []},
|
{env, []},
|
||||||
{licenses, ["Apache-2.0"]},
|
{licenses, ["Apache-2.0"]},
|
||||||
|
|
|
@ -47,7 +47,7 @@ start() ->
|
||||||
os:set_signal(sigterm, handle)
|
os:set_signal(sigterm, handle)
|
||||||
end,
|
end,
|
||||||
ok = set_backtrace_depth(),
|
ok = set_backtrace_depth(),
|
||||||
start_sysmon(),
|
ok = start_sysmon(),
|
||||||
configure_shard_transports(),
|
configure_shard_transports(),
|
||||||
set_mnesia_extra_diagnostic_checks(),
|
set_mnesia_extra_diagnostic_checks(),
|
||||||
emqx_otel_app:configure_otel_deps(),
|
emqx_otel_app:configure_otel_deps(),
|
||||||
|
|
|
@ -36,9 +36,6 @@
|
||||||
%% If any of these applications crash, the entire EMQX node shuts down:
|
%% If any of these applications crash, the entire EMQX node shuts down:
|
||||||
-define(BASIC_PERMANENT_APPS, [mria, ekka, esockd, emqx]).
|
-define(BASIC_PERMANENT_APPS, [mria, ekka, esockd, emqx]).
|
||||||
|
|
||||||
%% These apps should NOT be (re)started automatically:
|
|
||||||
-define(EXCLUDED_APPS, [system_monitor, observer_cli, jq]).
|
|
||||||
|
|
||||||
%% These apps are optional, they may or may not be present in the
|
%% These apps are optional, they may or may not be present in the
|
||||||
%% release, depending on the build flags:
|
%% release, depending on the build flags:
|
||||||
-define(OPTIONAL_APPS, [bcrypt, observer]).
|
-define(OPTIONAL_APPS, [bcrypt, observer]).
|
||||||
|
@ -157,7 +154,7 @@ basic_reboot_apps() ->
|
||||||
excluded_apps() ->
|
excluded_apps() ->
|
||||||
%% Optional apps _should_ be (re)started automatically, but only
|
%% Optional apps _should_ be (re)started automatically, but only
|
||||||
%% when they are found in the release:
|
%% when they are found in the release:
|
||||||
?EXCLUDED_APPS ++ [App || App <- ?OPTIONAL_APPS, not is_app(App)].
|
[App || App <- ?OPTIONAL_APPS, not is_app(App)].
|
||||||
|
|
||||||
is_app(Name) ->
|
is_app(Name) ->
|
||||||
case application:load(Name) of
|
case application:load(Name) of
|
||||||
|
|
|
@ -93,7 +93,7 @@ t_custom_shard_transports(_Config) ->
|
||||||
Shard = test_shard,
|
Shard = test_shard,
|
||||||
%% the config keys are binaries
|
%% the config keys are binaries
|
||||||
ShardBin = atom_to_binary(Shard),
|
ShardBin = atom_to_binary(Shard),
|
||||||
DefaultTransport = gen_rpc,
|
DefaultTransport = distr,
|
||||||
?assertEqual(DefaultTransport, mria_config:shard_transport(Shard)),
|
?assertEqual(DefaultTransport, mria_config:shard_transport(Shard)),
|
||||||
application:set_env(emqx_machine, custom_shard_transports, #{ShardBin => distr}),
|
application:set_env(emqx_machine, custom_shard_transports, #{ShardBin => distr}),
|
||||||
emqx_machine:start(),
|
emqx_machine:start(),
|
||||||
|
|
|
@ -5,7 +5,9 @@
|
||||||
{vsn, "5.0.34"},
|
{vsn, "5.0.34"},
|
||||||
{modules, []},
|
{modules, []},
|
||||||
{registered, [emqx_management_sup]},
|
{registered, [emqx_management_sup]},
|
||||||
{applications, [kernel, stdlib, emqx_plugins, minirest, emqx, emqx_ctl, emqx_bridge_http]},
|
{applications, [
|
||||||
|
kernel, stdlib, emqx_plugins, minirest, emqx, emqx_ctl, emqx_bridge_http, emqx_http_lib
|
||||||
|
]},
|
||||||
{mod, {emqx_mgmt_app, []}},
|
{mod, {emqx_mgmt_app, []}},
|
||||||
{env, []},
|
{env, []},
|
||||||
{licenses, ["Apache-2.0"]},
|
{licenses, ["Apache-2.0"]},
|
||||||
|
|
|
@ -105,7 +105,7 @@
|
||||||
}.
|
}.
|
||||||
|
|
||||||
-type db_error_details() :: #{mria:table() => {error, _}}.
|
-type db_error_details() :: #{mria:table() => {error, _}}.
|
||||||
-type config_error_details() :: #{emqx_utils_maps:config_path() => {error, _}}.
|
-type config_error_details() :: #{emqx_utils_maps:config_key_path() => {error, _}}.
|
||||||
-type import_res() ::
|
-type import_res() ::
|
||||||
{ok, #{db_errors => db_error_details(), config_errors => config_error_details()}} | {error, _}.
|
{ok, #{db_errors => db_error_details(), config_errors => config_error_details()}} | {error, _}.
|
||||||
|
|
||||||
|
|
|
@ -86,7 +86,7 @@
|
||||||
-export_type([with_id_return/0, with_id_return/1]).
|
-export_type([with_id_return/0, with_id_return/1]).
|
||||||
|
|
||||||
-type state() :: #{
|
-type state() :: #{
|
||||||
publish_timer := maybe(timer:tref()),
|
publish_timer := maybe(reference()),
|
||||||
publish_at := non_neg_integer(),
|
publish_at := non_neg_integer(),
|
||||||
stats_timer := maybe(reference()),
|
stats_timer := maybe(reference()),
|
||||||
stats_fun := maybe(fun((pos_integer()) -> ok))
|
stats_fun := maybe(fun((pos_integer()) -> ok))
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
{description, "EMQX Modules"},
|
{description, "EMQX Modules"},
|
||||||
{vsn, "5.0.24"},
|
{vsn, "5.0.24"},
|
||||||
{modules, []},
|
{modules, []},
|
||||||
{applications, [kernel, stdlib, emqx, emqx_ctl]},
|
{applications, [kernel, stdlib, emqx, emqx_ctl, observer_cli]},
|
||||||
{mod, {emqx_modules_app, []}},
|
{mod, {emqx_modules_app, []}},
|
||||||
{registered, [emqx_modules_sup]},
|
{registered, [emqx_modules_sup]},
|
||||||
{env, []}
|
{env, []}
|
||||||
|
|
|
@ -83,7 +83,7 @@ server() ->
|
||||||
%% ===================================================================
|
%% ===================================================================
|
||||||
callback_mode() -> always_sync.
|
callback_mode() -> always_sync.
|
||||||
|
|
||||||
-spec on_start(binary(), hoconsc:config()) -> {ok, state()} | {error, _}.
|
-spec on_start(binary(), hocon:config()) -> {ok, state()} | {error, _}.
|
||||||
on_start(
|
on_start(
|
||||||
InstId,
|
InstId,
|
||||||
#{
|
#{
|
||||||
|
|
|
@ -34,7 +34,8 @@
|
||||||
|
|
||||||
-export_type([
|
-export_type([
|
||||||
start_opts/0,
|
start_opts/0,
|
||||||
start_error/0
|
start_error/0,
|
||||||
|
migrate_to/0
|
||||||
]).
|
]).
|
||||||
|
|
||||||
-ifdef(TEST).
|
-ifdef(TEST).
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
% be sync for now.
|
% be sync for now.
|
||||||
callback_mode() -> always_sync.
|
callback_mode() -> always_sync.
|
||||||
|
|
||||||
-spec on_start(binary(), hoconsc:config()) -> {ok, state()} | {error, _}.
|
-spec on_start(binary(), hocon:config()) -> {ok, state()} | {error, _}.
|
||||||
on_start(
|
on_start(
|
||||||
InstId,
|
InstId,
|
||||||
#{
|
#{
|
||||||
|
|
|
@ -100,7 +100,7 @@ adjust_fields(Fields) ->
|
||||||
%% ===================================================================
|
%% ===================================================================
|
||||||
callback_mode() -> always_sync.
|
callback_mode() -> always_sync.
|
||||||
|
|
||||||
-spec on_start(binary(), hoconsc:config()) -> {ok, state()} | {error, _}.
|
-spec on_start(binary(), hocon:config()) -> {ok, state()} | {error, _}.
|
||||||
on_start(
|
on_start(
|
||||||
InstId,
|
InstId,
|
||||||
#{
|
#{
|
||||||
|
|
|
@ -42,7 +42,7 @@ deregister_cleanup(_) -> ok.
|
||||||
%% @private
|
%% @private
|
||||||
-spec collect_mf(_Registry, Callback) -> ok when
|
-spec collect_mf(_Registry, Callback) -> ok when
|
||||||
_Registry :: prometheus_registry:registry(),
|
_Registry :: prometheus_registry:registry(),
|
||||||
Callback :: prometheus_collector:callback().
|
Callback :: prometheus_collector:collect_mf_callback().
|
||||||
collect_mf(_Registry, Callback) ->
|
collect_mf(_Registry, Callback) ->
|
||||||
case mria_rlog:backend() of
|
case mria_rlog:backend() of
|
||||||
rlog ->
|
rlog ->
|
||||||
|
|
|
@ -80,8 +80,9 @@
|
||||||
-type queue_query() :: ?QUERY(reply_fun(), request(), HasBeenSent :: boolean(), expire_at()).
|
-type queue_query() :: ?QUERY(reply_fun(), request(), HasBeenSent :: boolean(), expire_at()).
|
||||||
-type request() :: term().
|
-type request() :: term().
|
||||||
-type request_from() :: undefined | gen_statem:from().
|
-type request_from() :: undefined | gen_statem:from().
|
||||||
-type request_ttl() :: infinity | timer:time().
|
-type timeout_ms() :: emqx_schema:timeout_duration_ms().
|
||||||
-type health_check_interval() :: timer:time().
|
-type request_ttl() :: emqx_schema:timeout_duration_ms().
|
||||||
|
-type health_check_interval() :: pos_integer().
|
||||||
-type state() :: blocked | running.
|
-type state() :: blocked | running.
|
||||||
-type inflight_key() :: integer().
|
-type inflight_key() :: integer().
|
||||||
-type counters() :: #{
|
-type counters() :: #{
|
||||||
|
@ -101,13 +102,13 @@
|
||||||
inflight_tid := inflight_table(),
|
inflight_tid := inflight_table(),
|
||||||
async_workers := #{pid() => reference()},
|
async_workers := #{pid() => reference()},
|
||||||
batch_size := pos_integer(),
|
batch_size := pos_integer(),
|
||||||
batch_time := timer:time(),
|
batch_time := timeout_ms(),
|
||||||
counters := counters(),
|
counters := counters(),
|
||||||
metrics_flush_interval := timer:time(),
|
metrics_flush_interval := timeout_ms(),
|
||||||
queue := replayq:q(),
|
queue := replayq:q(),
|
||||||
resume_interval := timer:time(),
|
resume_interval := timeout_ms(),
|
||||||
tref := undefined | {timer:tref() | reference(), reference()},
|
tref := undefined | {reference(), reference()},
|
||||||
metrics_tref := undefined | {timer:tref() | reference(), reference()}
|
metrics_tref := undefined | {reference(), reference()}
|
||||||
}.
|
}.
|
||||||
|
|
||||||
callback_mode() -> [state_functions, state_enter].
|
callback_mode() -> [state_functions, state_enter].
|
||||||
|
@ -2032,7 +2033,7 @@ replayq_opts(Id, Index, Opts) ->
|
||||||
%% timeout is <= resume interval and the buffer worker is ever
|
%% timeout is <= resume interval and the buffer worker is ever
|
||||||
%% blocked, than all queued requests will basically fail without being
|
%% blocked, than all queued requests will basically fail without being
|
||||||
%% attempted.
|
%% attempted.
|
||||||
-spec default_resume_interval(request_ttl(), health_check_interval()) -> timer:time().
|
-spec default_resume_interval(request_ttl(), health_check_interval()) -> timeout_ms().
|
||||||
default_resume_interval(_RequestTTL = infinity, HealthCheckInterval) ->
|
default_resume_interval(_RequestTTL = infinity, HealthCheckInterval) ->
|
||||||
max(1, HealthCheckInterval);
|
max(1, HealthCheckInterval);
|
||||||
default_resume_interval(RequestTTL, HealthCheckInterval) ->
|
default_resume_interval(RequestTTL, HealthCheckInterval) ->
|
||||||
|
|
|
@ -47,7 +47,8 @@ fields("resource_opts") ->
|
||||||
fields("creation_opts") ->
|
fields("creation_opts") ->
|
||||||
create_opts([]).
|
create_opts([]).
|
||||||
|
|
||||||
-spec create_opts([{atom(), hocon_schema:field_schema_map()}]) -> [{atom(), hocon_schema:field()}].
|
-spec create_opts([{atom(), hocon_schema:field_schema()}]) ->
|
||||||
|
[{atom(), hocon_schema:field_schema()}].
|
||||||
create_opts(Overrides) ->
|
create_opts(Overrides) ->
|
||||||
override(
|
override(
|
||||||
[
|
[
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
{profiles, [
|
{profiles, [
|
||||||
{test, [
|
{test, [
|
||||||
{deps, [
|
{deps, [
|
||||||
{emqtt, {git, "https://github.com/emqx/emqtt", {tag, "1.9.6"}}}
|
{emqtt, {git, "https://github.com/emqx/emqtt", {tag, "1.10.0"}}}
|
||||||
]}
|
]}
|
||||||
]}
|
]}
|
||||||
]}.
|
]}.
|
||||||
|
|
|
@ -307,7 +307,7 @@ clean(Context) ->
|
||||||
Mod = get_backend_module(),
|
Mod = get_backend_module(),
|
||||||
Mod:clean(Context).
|
Mod:clean(Context).
|
||||||
|
|
||||||
-spec update_config(state(), hocons:config(), hocons:config()) -> state().
|
-spec update_config(state(), hocon:config(), hocon:config()) -> state().
|
||||||
update_config(State, Conf, OldConf) ->
|
update_config(State, Conf, OldConf) ->
|
||||||
update_config(
|
update_config(
|
||||||
maps:get(enable, Conf),
|
maps:get(enable, Conf),
|
||||||
|
@ -317,7 +317,7 @@ update_config(State, Conf, OldConf) ->
|
||||||
OldConf
|
OldConf
|
||||||
).
|
).
|
||||||
|
|
||||||
-spec update_config(boolean(), boolean(), state(), hocons:config(), hocons:config()) -> state().
|
-spec update_config(boolean(), boolean(), state(), hocon:config(), hocon:config()) -> state().
|
||||||
update_config(false, _, State, _, _) ->
|
update_config(false, _, State, _, _) ->
|
||||||
disable_retainer(State);
|
disable_retainer(State);
|
||||||
update_config(true, false, State, NewConf, _) ->
|
update_config(true, false, State, NewConf, _) ->
|
||||||
|
|
|
@ -83,7 +83,7 @@ index_score(Index, Tokens) ->
|
||||||
%% Returns `undefined' if there are no indices with score `> 0'.
|
%% Returns `undefined' if there are no indices with score `> 0'.
|
||||||
%%
|
%%
|
||||||
%% @see index_score/2
|
%% @see index_score/2
|
||||||
-spec select_index(emqx:words(), list(index())) -> index() | undefined.
|
-spec select_index(emqx_types:words(), list(index())) -> index() | undefined.
|
||||||
select_index(Tokens, Indices) ->
|
select_index(Tokens, Indices) ->
|
||||||
select_index(Tokens, Indices, 0, undefined).
|
select_index(Tokens, Indices, 0, undefined).
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{application, emqx_s3, [
|
{application, emqx_s3, [
|
||||||
{description, "EMQX S3"},
|
{description, "EMQX S3"},
|
||||||
{vsn, "5.0.11"},
|
{vsn, "5.0.12"},
|
||||||
{modules, []},
|
{modules, []},
|
||||||
{registered, [emqx_s3_sup]},
|
{registered, [emqx_s3_sup]},
|
||||||
{applications, [
|
{applications, [
|
||||||
|
|
|
@ -82,7 +82,7 @@ update_profile(ProfileId, ProfileConfig) when ?IS_PROFILE_ID(ProfileId) ->
|
||||||
emqx_s3_profile_conf:update_config(ProfileId, ProfileConfig).
|
emqx_s3_profile_conf:update_config(ProfileId, ProfileConfig).
|
||||||
|
|
||||||
-spec start_uploader(profile_id(), emqx_s3_uploader:opts()) ->
|
-spec start_uploader(profile_id(), emqx_s3_uploader:opts()) ->
|
||||||
supervisor:start_ret() | {error, profile_not_found}.
|
emqx_types:startlink_ret() | {error, profile_not_found}.
|
||||||
start_uploader(ProfileId, Opts) when ?IS_PROFILE_ID(ProfileId) ->
|
start_uploader(ProfileId, Opts) when ?IS_PROFILE_ID(ProfileId) ->
|
||||||
emqx_s3_profile_uploader_sup:start_uploader(ProfileId, Opts).
|
emqx_s3_profile_uploader_sup:start_uploader(ProfileId, Opts).
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,12 @@
|
||||||
|
|
||||||
-export_type([
|
-export_type([
|
||||||
client/0,
|
client/0,
|
||||||
headers/0
|
headers/0,
|
||||||
|
key/0,
|
||||||
|
upload_id/0,
|
||||||
|
etag/0,
|
||||||
|
part_number/0,
|
||||||
|
config/0
|
||||||
]).
|
]).
|
||||||
|
|
||||||
-type headers() :: #{binary() | string() => iodata()}.
|
-type headers() :: #{binary() | string() => iodata()}.
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
-export([init/1]).
|
-export([init/1]).
|
||||||
|
|
||||||
-spec start_link(emqx_s3:profile_id(), emqx_s3:profile_config()) -> supervisor:start_ret().
|
-spec start_link(emqx_s3:profile_id(), emqx_s3:profile_config()) -> emqx_types:startlink_ret().
|
||||||
start_link(ProfileId, ProfileConfig) ->
|
start_link(ProfileId, ProfileConfig) ->
|
||||||
supervisor:start_link(?MODULE, [ProfileId, ProfileConfig]).
|
supervisor:start_link(?MODULE, [ProfileId, ProfileConfig]).
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
-type id() :: {?MODULE, emqx_s3:profile_id()}.
|
-type id() :: {?MODULE, emqx_s3:profile_id()}.
|
||||||
|
|
||||||
-spec start_link(emqx_s3:profile_id()) -> supervisor:start_ret().
|
-spec start_link(emqx_s3:profile_id()) -> emqx_types:startlink_ret().
|
||||||
start_link(ProfileId) ->
|
start_link(ProfileId) ->
|
||||||
supervisor:start_link(?VIA_GPROC(id(ProfileId)), ?MODULE, [ProfileId]).
|
supervisor:start_link(?VIA_GPROC(id(ProfileId)), ?MODULE, [ProfileId]).
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ id(ProfileId) ->
|
||||||
{?MODULE, ProfileId}.
|
{?MODULE, ProfileId}.
|
||||||
|
|
||||||
-spec start_uploader(emqx_s3:profile_id(), emqx_s3_uploader:opts()) ->
|
-spec start_uploader(emqx_s3:profile_id(), emqx_s3_uploader:opts()) ->
|
||||||
supervisor:start_ret() | {error, profile_not_found}.
|
emqx_types:startlink_ret() | {error, profile_not_found}.
|
||||||
start_uploader(ProfileId, Opts) ->
|
start_uploader(ProfileId, Opts) ->
|
||||||
try supervisor:start_child(?VIA_GPROC(id(ProfileId)), [Opts]) of
|
try supervisor:start_child(?VIA_GPROC(id(ProfileId)), [Opts]) of
|
||||||
Result -> Result
|
Result -> Result
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
-export([init/1]).
|
-export([init/1]).
|
||||||
|
|
||||||
-spec start_link() -> supervisor:start_ret().
|
-spec start_link() -> emqx_types:startlink_ret().
|
||||||
start_link() ->
|
start_link() ->
|
||||||
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
|
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,12 @@
|
||||||
format_status/2
|
format_status/2
|
||||||
]).
|
]).
|
||||||
|
|
||||||
-export_type([opts/0]).
|
-export_type([opts/0, config/0]).
|
||||||
|
|
||||||
|
-type config() :: #{
|
||||||
|
min_part_size => pos_integer(),
|
||||||
|
max_part_size => pos_integer()
|
||||||
|
}.
|
||||||
|
|
||||||
-type opts() :: #{
|
-type opts() :: #{
|
||||||
key := string(),
|
key := string(),
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
]}.
|
]}.
|
||||||
|
|
||||||
{deps, [
|
{deps, [
|
||||||
{jiffy, {git, "https://github.com/emqx/jiffy", {tag, "1.0.5"}}}
|
{jiffy, {git, "https://github.com/emqx/jiffy", {tag, "1.0.6"}}}
|
||||||
]}.
|
]}.
|
||||||
|
|
||||||
{project_plugins, [erlfmt]}.
|
{project_plugins, [erlfmt]}.
|
||||||
|
|
|
@ -191,7 +191,7 @@ push_err(Line, Err, S = #s{errors = Errs}) ->
|
||||||
push_target(Target, S = #s{targets = Targets}) ->
|
push_target(Target, S = #s{targets = Targets}) ->
|
||||||
S#s{targets = [Target | Targets]}.
|
S#s{targets = [Target | Targets]}.
|
||||||
|
|
||||||
-spec api_and_version(module()) -> {ok, emqx_bpapi:api(), emqx_bpapi:version()} | error.
|
-spec api_and_version(module()) -> {ok, emqx_bpapi:api(), emqx_bpapi:api_version()} | error.
|
||||||
api_and_version(Module) ->
|
api_and_version(Module) ->
|
||||||
Opts = [{capture, all_but_first, list}],
|
Opts = [{capture, all_but_first, list}],
|
||||||
case re:run(atom_to_list(Module), "(.*)_proto_v([0-9]+)$", Opts) of
|
case re:run(atom_to_list(Module), "(.*)_proto_v([0-9]+)$", Opts) of
|
||||||
|
|
|
@ -79,6 +79,12 @@
|
||||||
|
|
||||||
-export([clamp/3, redact/1, redact/2, is_redacted/2, is_redacted/3]).
|
-export([clamp/3, redact/1, redact/2, is_redacted/2, is_redacted/3]).
|
||||||
|
|
||||||
|
-export_type([
|
||||||
|
readable_error_msg/1
|
||||||
|
]).
|
||||||
|
|
||||||
|
-type readable_error_msg(_Error) :: binary().
|
||||||
|
|
||||||
-type maybe(T) :: undefined | T.
|
-type maybe(T) :: undefined | T.
|
||||||
|
|
||||||
-dialyzer({nowarn_function, [nolink_apply/2]}).
|
-dialyzer({nowarn_function, [nolink_apply/2]}).
|
||||||
|
@ -435,7 +441,7 @@ pmap(Fun, List, Timeout) when
|
||||||
nolink_apply(Fun) -> nolink_apply(Fun, infinity).
|
nolink_apply(Fun) -> nolink_apply(Fun, infinity).
|
||||||
|
|
||||||
%% @doc Same as `nolink_apply/1', with a timeout.
|
%% @doc Same as `nolink_apply/1', with a timeout.
|
||||||
-spec nolink_apply(function(), timer:timeout()) -> term().
|
-spec nolink_apply(function(), timeout()) -> term().
|
||||||
nolink_apply(Fun, Timeout) when is_function(Fun, 0) ->
|
nolink_apply(Fun, Timeout) when is_function(Fun, 0) ->
|
||||||
Caller = self(),
|
Caller = self(),
|
||||||
ResRef = alias([reply]),
|
ResRef = alias([reply]),
|
||||||
|
|
10
mix.exs
10
mix.exs
|
@ -51,11 +51,11 @@ defmodule EMQXUmbrella.MixProject do
|
||||||
{:typerefl, github: "ieQu1/typerefl", tag: "0.9.1", override: true},
|
{:typerefl, github: "ieQu1/typerefl", tag: "0.9.1", override: true},
|
||||||
{:ehttpc, github: "emqx/ehttpc", tag: "0.4.11", override: true},
|
{:ehttpc, github: "emqx/ehttpc", tag: "0.4.11", override: true},
|
||||||
{:gproc, github: "emqx/gproc", tag: "0.9.0.1", override: true},
|
{:gproc, github: "emqx/gproc", tag: "0.9.0.1", override: true},
|
||||||
{:jiffy, github: "emqx/jiffy", tag: "1.0.5", override: true},
|
{:jiffy, github: "emqx/jiffy", tag: "1.0.6", override: true},
|
||||||
{:cowboy, github: "emqx/cowboy", tag: "2.9.2", override: true},
|
{:cowboy, github: "emqx/cowboy", tag: "2.9.2", override: true},
|
||||||
{:esockd, github: "emqx/esockd", tag: "5.9.9", override: true},
|
{:esockd, github: "emqx/esockd", tag: "5.9.9", override: true},
|
||||||
{:rocksdb, github: "emqx/erlang-rocksdb", tag: "1.8.0-emqx-1", override: true},
|
{:rocksdb, github: "emqx/erlang-rocksdb", tag: "1.8.0-emqx-2", override: true},
|
||||||
{:ekka, github: "emqx/ekka", tag: "0.15.16", override: true},
|
{:ekka, github: "emqx/ekka", tag: "0.17.0", override: true},
|
||||||
{:gen_rpc, github: "emqx/gen_rpc", tag: "3.3.0", override: true},
|
{:gen_rpc, github: "emqx/gen_rpc", tag: "3.3.0", override: true},
|
||||||
{:grpc, github: "emqx/grpc-erl", tag: "0.6.12", override: true},
|
{:grpc, github: "emqx/grpc-erl", tag: "0.6.12", override: true},
|
||||||
{:minirest, github: "emqx/minirest", tag: "1.3.15", override: true},
|
{:minirest, github: "emqx/minirest", tag: "1.3.15", override: true},
|
||||||
|
@ -64,7 +64,7 @@ defmodule EMQXUmbrella.MixProject do
|
||||||
{:pbkdf2, github: "emqx/erlang-pbkdf2", tag: "2.0.4", override: true},
|
{:pbkdf2, github: "emqx/erlang-pbkdf2", tag: "2.0.4", override: true},
|
||||||
# maybe forbid to fetch quicer
|
# maybe forbid to fetch quicer
|
||||||
{:emqtt,
|
{:emqtt,
|
||||||
github: "emqx/emqtt", tag: "1.9.7", override: true, system_env: maybe_no_quic_env()},
|
github: "emqx/emqtt", tag: "1.10.0", override: true, system_env: maybe_no_quic_env()},
|
||||||
{:rulesql, github: "emqx/rulesql", tag: "0.1.7"},
|
{:rulesql, github: "emqx/rulesql", tag: "0.1.7"},
|
||||||
{:observer_cli, "1.7.1"},
|
{:observer_cli, "1.7.1"},
|
||||||
{:system_monitor, github: "ieQu1/system_monitor", tag: "3.0.3"},
|
{:system_monitor, github: "ieQu1/system_monitor", tag: "3.0.3"},
|
||||||
|
@ -72,7 +72,7 @@ defmodule EMQXUmbrella.MixProject do
|
||||||
# in conflict by emqtt and hocon
|
# in conflict by emqtt and hocon
|
||||||
{:getopt, "1.0.2", override: true},
|
{:getopt, "1.0.2", override: true},
|
||||||
{:snabbkaffe, github: "kafka4beam/snabbkaffe", tag: "1.0.8", override: true},
|
{:snabbkaffe, github: "kafka4beam/snabbkaffe", tag: "1.0.8", override: true},
|
||||||
{:hocon, github: "emqx/hocon", tag: "0.40.0", override: true},
|
{:hocon, github: "emqx/hocon", tag: "0.40.1", override: true},
|
||||||
{:emqx_http_lib, github: "emqx/emqx_http_lib", tag: "0.5.3", override: true},
|
{:emqx_http_lib, github: "emqx/emqx_http_lib", tag: "0.5.3", override: true},
|
||||||
{:esasl, github: "emqx/esasl", tag: "0.2.0"},
|
{:esasl, github: "emqx/esasl", tag: "0.2.0"},
|
||||||
{:jose, github: "potatosalad/erlang-jose", tag: "1.11.2"},
|
{:jose, github: "potatosalad/erlang-jose", tag: "1.11.2"},
|
||||||
|
|
21
rebar.config
21
rebar.config
|
@ -28,6 +28,15 @@
|
||||||
|
|
||||||
{dialyzer, [
|
{dialyzer, [
|
||||||
{warnings, [unmatched_returns, error_handling]},
|
{warnings, [unmatched_returns, error_handling]},
|
||||||
|
{exclude_mods, [emqx_exproto_v_1_connection_unary_handler_bhvr,
|
||||||
|
emqx_exproto_v_1_connection_handler_client,
|
||||||
|
emqx_exproto_v_1_connection_handler_bhvr,
|
||||||
|
emqx_exproto_v_1_connection_adapter_client,
|
||||||
|
emqx_exproto_v_1_connection_adapter_bhvr,
|
||||||
|
emqx_exproto_v_1_connection_unary_handler_client,
|
||||||
|
emqx_exhook_v_2_hook_provider_client,
|
||||||
|
emqx_exhook_v_2_hook_provider_bhvr
|
||||||
|
]},
|
||||||
{plt_location, "."},
|
{plt_location, "."},
|
||||||
{plt_prefix, "emqx_dialyzer"},
|
{plt_prefix, "emqx_dialyzer"},
|
||||||
{plt_apps, all_apps},
|
{plt_apps, all_apps},
|
||||||
|
@ -58,29 +67,31 @@
|
||||||
, {gun, {git, "https://github.com/emqx/gun", {tag, "1.3.9"}}}
|
, {gun, {git, "https://github.com/emqx/gun", {tag, "1.3.9"}}}
|
||||||
, {ehttpc, {git, "https://github.com/emqx/ehttpc", {tag, "0.4.11"}}}
|
, {ehttpc, {git, "https://github.com/emqx/ehttpc", {tag, "0.4.11"}}}
|
||||||
, {gproc, {git, "https://github.com/emqx/gproc", {tag, "0.9.0.1"}}}
|
, {gproc, {git, "https://github.com/emqx/gproc", {tag, "0.9.0.1"}}}
|
||||||
, {jiffy, {git, "https://github.com/emqx/jiffy", {tag, "1.0.5"}}}
|
, {jiffy, {git, "https://github.com/emqx/jiffy", {tag, "1.0.6"}}}
|
||||||
, {cowboy, {git, "https://github.com/emqx/cowboy", {tag, "2.9.2"}}}
|
, {cowboy, {git, "https://github.com/emqx/cowboy", {tag, "2.9.2"}}}
|
||||||
, {esockd, {git, "https://github.com/emqx/esockd", {tag, "5.9.9"}}}
|
, {esockd, {git, "https://github.com/emqx/esockd", {tag, "5.9.9"}}}
|
||||||
, {rocksdb, {git, "https://github.com/emqx/erlang-rocksdb", {tag, "1.8.0-emqx-1"}}}
|
, {rocksdb, {git, "https://github.com/emqx/erlang-rocksdb", {tag, "1.8.0-emqx-2"}}}
|
||||||
, {ekka, {git, "https://github.com/emqx/ekka", {tag, "0.15.16"}}}
|
, {ekka, {git, "https://github.com/emqx/ekka", {tag, "0.17.0"}}}
|
||||||
, {gen_rpc, {git, "https://github.com/emqx/gen_rpc", {tag, "3.3.0"}}}
|
, {gen_rpc, {git, "https://github.com/emqx/gen_rpc", {tag, "3.3.0"}}}
|
||||||
, {grpc, {git, "https://github.com/emqx/grpc-erl", {tag, "0.6.12"}}}
|
, {grpc, {git, "https://github.com/emqx/grpc-erl", {tag, "0.6.12"}}}
|
||||||
, {minirest, {git, "https://github.com/emqx/minirest", {tag, "1.3.15"}}}
|
, {minirest, {git, "https://github.com/emqx/minirest", {tag, "1.3.15"}}}
|
||||||
, {ecpool, {git, "https://github.com/emqx/ecpool", {tag, "0.5.4"}}}
|
, {ecpool, {git, "https://github.com/emqx/ecpool", {tag, "0.5.4"}}}
|
||||||
, {replayq, {git, "https://github.com/emqx/replayq.git", {tag, "0.3.7"}}}
|
, {replayq, {git, "https://github.com/emqx/replayq.git", {tag, "0.3.7"}}}
|
||||||
, {pbkdf2, {git, "https://github.com/emqx/erlang-pbkdf2.git", {tag, "2.0.4"}}}
|
, {pbkdf2, {git, "https://github.com/emqx/erlang-pbkdf2.git", {tag, "2.0.4"}}}
|
||||||
, {emqtt, {git, "https://github.com/emqx/emqtt", {tag, "1.9.7"}}}
|
, {emqtt, {git, "https://github.com/emqx/emqtt", {tag, "1.10.0"}}}
|
||||||
, {rulesql, {git, "https://github.com/emqx/rulesql", {tag, "0.1.7"}}}
|
, {rulesql, {git, "https://github.com/emqx/rulesql", {tag, "0.1.7"}}}
|
||||||
, {observer_cli, "1.7.1"} % NOTE: depends on recon 2.5.x
|
, {observer_cli, "1.7.1"} % NOTE: depends on recon 2.5.x
|
||||||
, {system_monitor, {git, "https://github.com/ieQu1/system_monitor", {tag, "3.0.3"}}}
|
, {system_monitor, {git, "https://github.com/ieQu1/system_monitor", {tag, "3.0.3"}}}
|
||||||
, {getopt, "1.0.2"}
|
, {getopt, "1.0.2"}
|
||||||
, {snabbkaffe, {git, "https://github.com/kafka4beam/snabbkaffe.git", {tag, "1.0.8"}}}
|
, {snabbkaffe, {git, "https://github.com/kafka4beam/snabbkaffe.git", {tag, "1.0.8"}}}
|
||||||
, {hocon, {git, "https://github.com/emqx/hocon.git", {tag, "0.40.0"}}}
|
, {hocon, {git, "https://github.com/emqx/hocon.git", {tag, "0.40.1"}}}
|
||||||
, {emqx_http_lib, {git, "https://github.com/emqx/emqx_http_lib.git", {tag, "0.5.3"}}}
|
, {emqx_http_lib, {git, "https://github.com/emqx/emqx_http_lib.git", {tag, "0.5.3"}}}
|
||||||
, {esasl, {git, "https://github.com/emqx/esasl", {tag, "0.2.0"}}}
|
, {esasl, {git, "https://github.com/emqx/esasl", {tag, "0.2.0"}}}
|
||||||
, {jose, {git, "https://github.com/potatosalad/erlang-jose", {tag, "1.11.2"}}}
|
, {jose, {git, "https://github.com/potatosalad/erlang-jose", {tag, "1.11.2"}}}
|
||||||
, {telemetry, "1.1.0"}
|
, {telemetry, "1.1.0"}
|
||||||
, {hackney, {git, "https://github.com/emqx/hackney.git", {tag, "1.18.1-1"}}}
|
, {hackney, {git, "https://github.com/emqx/hackney.git", {tag, "1.18.1-1"}}}
|
||||||
|
%% to keep in sync with mix.exs
|
||||||
|
, {ssl_verify_fun, "1.1.7"}
|
||||||
%% in conflict by erlavro and rocketmq
|
%% in conflict by erlavro and rocketmq
|
||||||
, {jsone, {git, "https://github.com/emqx/jsone.git", {tag, "1.7.1"}}}
|
, {jsone, {git, "https://github.com/emqx/jsone.git", {tag, "1.7.1"}}}
|
||||||
, {uuid, {git, "https://github.com/okeuday/uuid.git", {tag, "v2.0.6"}}}
|
, {uuid, {git, "https://github.com/okeuday/uuid.git", {tag, "v2.0.6"}}}
|
||||||
|
|
Loading…
Reference in New Issue