style(behaviour attrs): unify behaviour declarations
This commit is contained in:
parent
d784e63b9f
commit
e37ecc10a6
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
-module(emqx_metrics).
|
-module(emqx_metrics).
|
||||||
|
|
||||||
-behavior(gen_server).
|
-behaviour(gen_server).
|
||||||
|
|
||||||
-include("emqx.hrl").
|
-include("emqx.hrl").
|
||||||
-include("logger.hrl").
|
-include("logger.hrl").
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
-module(emqx_sys_mon).
|
-module(emqx_sys_mon).
|
||||||
|
|
||||||
-behavior(gen_server).
|
-behaviour(gen_server).
|
||||||
|
|
||||||
-include("types.hrl").
|
-include("types.hrl").
|
||||||
-include("logger.hrl").
|
-include("logger.hrl").
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
-module(emqx_authn_api).
|
-module(emqx_authn_api).
|
||||||
|
|
||||||
-behavior(minirest_api).
|
-behaviour(minirest_api).
|
||||||
|
|
||||||
-include("emqx_authn.hrl").
|
-include("emqx_authn.hrl").
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@
|
||||||
},
|
},
|
||||||
topology => #{
|
topology => #{
|
||||||
max_overflow => 8,
|
max_overflow => 8,
|
||||||
pool_size => 8
|
pool_size => 8
|
||||||
},
|
},
|
||||||
enable => true})).
|
enable => true})).
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
-module(emqx_authz_api_mnesia).
|
-module(emqx_authz_api_mnesia).
|
||||||
|
|
||||||
-behavior(minirest_api).
|
-behaviour(minirest_api).
|
||||||
|
|
||||||
-include("emqx_authz.hrl").
|
-include("emqx_authz.hrl").
|
||||||
-include_lib("emqx/include/logger.hrl").
|
-include_lib("emqx/include/logger.hrl").
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
-module(emqx_authz_api_settings).
|
-module(emqx_authz_api_settings).
|
||||||
|
|
||||||
-behavior(minirest_api).
|
-behaviour(minirest_api).
|
||||||
|
|
||||||
-export([ api_spec/0
|
-export([ api_spec/0
|
||||||
, settings/2
|
, settings/2
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
-module(emqx_authz_api_sources).
|
-module(emqx_authz_api_sources).
|
||||||
|
|
||||||
-behavior(minirest_api).
|
-behaviour(minirest_api).
|
||||||
|
|
||||||
-include("emqx_authz.hrl").
|
-include("emqx_authz.hrl").
|
||||||
-include_lib("emqx/include/logger.hrl").
|
-include_lib("emqx/include/logger.hrl").
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
-module(emqx_exhook_demo_svr).
|
-module(emqx_exhook_demo_svr).
|
||||||
|
|
||||||
-behavior(emqx_exhook_v_1_hook_provider_bhvr).
|
-behaviour(emqx_exhook_v_1_hook_provider_bhvr).
|
||||||
|
|
||||||
%%
|
%%
|
||||||
-export([ start/0
|
-export([ start/0
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
-module(emqx_coap_channel).
|
-module(emqx_coap_channel).
|
||||||
|
|
||||||
-behavior(emqx_gateway_channel).
|
-behaviour(emqx_gateway_channel).
|
||||||
|
|
||||||
-include_lib("emqx/include/logger.hrl").
|
-include_lib("emqx/include/logger.hrl").
|
||||||
-include_lib("emqx_gateway/src/coap/include/emqx_coap.hrl").
|
-include_lib("emqx_gateway/src/coap/include/emqx_coap.hrl").
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
-module(emqx_coap_frame).
|
-module(emqx_coap_frame).
|
||||||
|
|
||||||
-behavior(emqx_gateway_frame).
|
-behaviour(emqx_gateway_frame).
|
||||||
|
|
||||||
%% emqx_gateway_frame API
|
%% emqx_gateway_frame API
|
||||||
-export([ initial_parse_state/1
|
-export([ initial_parse_state/1
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
-include_lib("emqx_gateway/include/emqx_gateway.hrl").
|
-include_lib("emqx_gateway/include/emqx_gateway.hrl").
|
||||||
|
|
||||||
-behavior(emqx_gateway_impl).
|
-behaviour(emqx_gateway_impl).
|
||||||
|
|
||||||
%% APIs
|
%% APIs
|
||||||
-export([ reg/0
|
-export([ reg/0
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
-include("include/emqx_gateway.hrl").
|
-include("include/emqx_gateway.hrl").
|
||||||
|
|
||||||
-behavior(gen_server).
|
-behaviour(gen_server).
|
||||||
|
|
||||||
%% APIs
|
%% APIs
|
||||||
-export([ reg/2
|
-export([ reg/2
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
%% @doc The frame parser for ExProto
|
%% @doc The frame parser for ExProto
|
||||||
-module(emqx_exproto_frame).
|
-module(emqx_exproto_frame).
|
||||||
|
|
||||||
-behavior(emqx_gateway_frame).
|
-behaviour(emqx_gateway_frame).
|
||||||
|
|
||||||
-export([ initial_parse_state/1
|
-export([ initial_parse_state/1
|
||||||
, serialize_opts/0
|
, serialize_opts/0
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
%% The gRPC server for ConnectionAdapter
|
%% The gRPC server for ConnectionAdapter
|
||||||
-module(emqx_exproto_gsvr).
|
-module(emqx_exproto_gsvr).
|
||||||
|
|
||||||
% -behavior(emqx_exproto_v_1_connection_adapter_bhvr).
|
% -behaviour(emqx_exproto_v_1_connection_adapter_bhvr).
|
||||||
|
|
||||||
-include("src/exproto/include/emqx_exproto.hrl").
|
-include("src/exproto/include/emqx_exproto.hrl").
|
||||||
-include_lib("emqx/include/logger.hrl").
|
-include_lib("emqx/include/logger.hrl").
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
%% @doc The ExProto Gateway Implement interface
|
%% @doc The ExProto Gateway Implement interface
|
||||||
-module(emqx_exproto_impl).
|
-module(emqx_exproto_impl).
|
||||||
|
|
||||||
-behavior(emqx_gateway_impl).
|
-behaviour(emqx_gateway_impl).
|
||||||
|
|
||||||
%% APIs
|
%% APIs
|
||||||
-export([ reg/0
|
-export([ reg/0
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
%% @doc The LwM2M Gateway Implement interface
|
%% @doc The LwM2M Gateway Implement interface
|
||||||
-module(emqx_lwm2m_impl).
|
-module(emqx_lwm2m_impl).
|
||||||
|
|
||||||
-behavior(emqx_gateway_impl).
|
-behaviour(emqx_gateway_impl).
|
||||||
|
|
||||||
%% APIs
|
%% APIs
|
||||||
-export([ reg/0
|
-export([ reg/0
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
-module(emqx_sn_channel).
|
-module(emqx_sn_channel).
|
||||||
|
|
||||||
-behavior(emqx_gateway_channel).
|
-behaviour(emqx_gateway_channel).
|
||||||
|
|
||||||
-include("src/mqttsn/include/emqx_sn.hrl").
|
-include("src/mqttsn/include/emqx_sn.hrl").
|
||||||
-include_lib("emqx/include/emqx.hrl").
|
-include_lib("emqx/include/emqx.hrl").
|
||||||
|
@ -1042,7 +1042,7 @@ handle_out(connack, ?SN_RC_ACCEPTED,
|
||||||
Channel = #channel{ctx = Ctx, conninfo = ConnInfo}) ->
|
Channel = #channel{ctx = Ctx, conninfo = ConnInfo}) ->
|
||||||
_ = run_hooks(Ctx, 'client.connack',
|
_ = run_hooks(Ctx, 'client.connack',
|
||||||
[ConnInfo, returncode_name(?SN_RC_ACCEPTED)],
|
[ConnInfo, returncode_name(?SN_RC_ACCEPTED)],
|
||||||
#{}
|
#{}
|
||||||
),
|
),
|
||||||
return_connack(?SN_CONNACK_MSG(?SN_RC_ACCEPTED),
|
return_connack(?SN_CONNACK_MSG(?SN_RC_ACCEPTED),
|
||||||
ensure_keepalive(Channel));
|
ensure_keepalive(Channel));
|
||||||
|
@ -1325,7 +1325,7 @@ handle_deliver(Delivers, Channel = #channel{
|
||||||
ctx = Ctx,
|
ctx = Ctx,
|
||||||
conn_state = ConnState,
|
conn_state = ConnState,
|
||||||
session = Session,
|
session = Session,
|
||||||
clientinfo = #{clientid := ClientId}})
|
clientinfo = #{clientid := ClientId}})
|
||||||
when ConnState =:= disconnected;
|
when ConnState =:= disconnected;
|
||||||
ConnState =:= asleep ->
|
ConnState =:= asleep ->
|
||||||
NSession = emqx_session:enqueue(
|
NSession = emqx_session:enqueue(
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
%% @doc The frame parser for MQTT-SN protocol
|
%% @doc The frame parser for MQTT-SN protocol
|
||||||
-module(emqx_sn_frame).
|
-module(emqx_sn_frame).
|
||||||
|
|
||||||
-behavior(emqx_gateway_frame).
|
-behaviour(emqx_gateway_frame).
|
||||||
|
|
||||||
-include("src/mqttsn/include/emqx_sn.hrl").
|
-include("src/mqttsn/include/emqx_sn.hrl").
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
%% @doc The MQTT-SN Gateway Implement interface
|
%% @doc The MQTT-SN Gateway Implement interface
|
||||||
-module(emqx_sn_impl).
|
-module(emqx_sn_impl).
|
||||||
|
|
||||||
-behavior(emqx_gateway_impl).
|
-behaviour(emqx_gateway_impl).
|
||||||
|
|
||||||
%% APIs
|
%% APIs
|
||||||
-export([ reg/0
|
-export([ reg/0
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
-module(emqx_stomp_channel).
|
-module(emqx_stomp_channel).
|
||||||
|
|
||||||
-behavior(emqx_gateway_channel).
|
-behaviour(emqx_gateway_channel).
|
||||||
|
|
||||||
-include("src/stomp/include/emqx_stomp.hrl").
|
-include("src/stomp/include/emqx_stomp.hrl").
|
||||||
-include_lib("emqx/include/emqx.hrl").
|
-include_lib("emqx/include/emqx.hrl").
|
||||||
|
|
|
@ -68,7 +68,7 @@
|
||||||
|
|
||||||
-module(emqx_stomp_frame).
|
-module(emqx_stomp_frame).
|
||||||
|
|
||||||
-behavior(emqx_gateway_frame).
|
-behaviour(emqx_gateway_frame).
|
||||||
|
|
||||||
-include("src/stomp/include/emqx_stomp.hrl").
|
-include("src/stomp/include/emqx_stomp.hrl").
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
-module(emqx_stomp_impl).
|
-module(emqx_stomp_impl).
|
||||||
|
|
||||||
-behavior(emqx_gateway_impl).
|
-behaviour(emqx_gateway_impl).
|
||||||
|
|
||||||
%% APIs
|
%% APIs
|
||||||
-export([ reg/0
|
-export([ reg/0
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
-module(emqx_exproto_echo_svr).
|
-module(emqx_exproto_echo_svr).
|
||||||
|
|
||||||
-behavior(emqx_exproto_v_1_connection_handler_bhvr).
|
-behaviour(emqx_exproto_v_1_connection_handler_bhvr).
|
||||||
|
|
||||||
-export([ start/0
|
-export([ start/0
|
||||||
, stop/1
|
, stop/1
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
-module(emqx_delayed_api).
|
-module(emqx_delayed_api).
|
||||||
|
|
||||||
-behavior(minirest_api).
|
-behaviour(minirest_api).
|
||||||
|
|
||||||
-include_lib("typerefl/include/types.hrl").
|
-include_lib("typerefl/include/types.hrl").
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
-module(emqx_telemetry_api).
|
-module(emqx_telemetry_api).
|
||||||
|
|
||||||
-behavior(minirest_api).
|
-behaviour(minirest_api).
|
||||||
|
|
||||||
-import(emqx_mgmt_util, [ schema/1
|
-import(emqx_mgmt_util, [ schema/1
|
||||||
, object_schema/1
|
, object_schema/1
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
%% TODO: refactor uri path
|
%% TODO: refactor uri path
|
||||||
-module(emqx_topic_metrics_api).
|
-module(emqx_topic_metrics_api).
|
||||||
|
|
||||||
-behavior(minirest_api).
|
-behaviour(minirest_api).
|
||||||
|
|
||||||
-import(emqx_mgmt_util, [ properties/1
|
-import(emqx_mgmt_util, [ properties/1
|
||||||
, schema/1
|
, schema/1
|
||||||
|
|
Loading…
Reference in New Issue