From fc92e4c8bf454820c4da164c7a847e700f9c8dae Mon Sep 17 00:00:00 2001 From: Kian-Meng Ang Date: Thu, 27 Jan 2022 08:41:44 +0800 Subject: [PATCH] docs: fix typos --- .github/ISSUE_TEMPLATE/assets/issue-handling.uml | 2 +- Windows.md | 8 ++++---- apps/emqx/etc/emqx.conf | 2 +- apps/emqx/src/emqx_authentication.erl | 2 +- apps/emqx/src/emqx_config.erl | 4 ++-- apps/emqx/src/emqx_config_handler.erl | 2 +- apps/emqx/src/emqx_connection.erl | 2 +- .../src/emqx_limiter/src/emqx_limiter.app.src | 2 +- .../src/emqx_limiter/src/emqx_limiter_server.erl | 4 ++-- apps/emqx/src/emqx_olp.erl | 6 +++--- apps/emqx/src/emqx_pqueue.erl | 2 +- apps/emqx/src/emqx_release.erl | 2 +- apps/emqx/src/emqx_schema.erl | 4 ++-- apps/emqx/src/emqx_session.erl | 4 ++-- apps/emqx/src/emqx_tls_lib.erl | 2 +- apps/emqx/src/emqx_trie.erl | 2 +- apps/emqx/test/emqx_logger_SUITE.erl | 2 +- apps/emqx/test/emqx_ratelimiter_SUITE.erl | 2 +- apps/emqx/test/emqx_request_responser_SUITE.erl | 6 +++--- apps/emqx/test/emqx_takeover_SUITE.erl | 2 +- apps/emqx/test/props/prop_emqx_json.erl | 2 +- apps/emqx_authn/src/emqx_authn_api.erl | 2 +- apps/emqx_authn/src/emqx_authn_schema.erl | 4 ++-- .../test/emqx_authn_mongo_tls_SUITE.erl | 2 +- apps/emqx_authz/src/emqx_authz.erl | 2 +- apps/emqx_authz/src/emqx_authz_schema.erl | 2 +- apps/emqx_conf/etc/emqx_conf.conf | 16 ++++++++-------- apps/emqx_conf/etc/emqx_conf.md | 12 ++++++------ apps/emqx_conf/src/emqx_conf_schema.erl | 4 ++-- apps/emqx_connector/src/emqx_connector_http.erl | 6 +++--- .../src/mqtt/emqx_connector_mqtt_mod.erl | 2 +- .../src/mqtt/emqx_connector_mqtt_schema.erl | 2 +- .../src/mqtt/emqx_connector_mqtt_worker.erl | 4 ++-- .../test/emqx_connector_mqtt_worker_tests.erl | 2 +- apps/emqx_dashboard/README.md | 2 +- .../emqx_dashboard/src/emqx_dashboard_schema.erl | 2 +- .../src/emqx_dashboard_swagger.erl | 2 +- apps/emqx_exhook/README.md | 2 +- apps/emqx_exhook/priv/protos/exhook.proto | 8 ++++---- apps/emqx_exhook/src/emqx_exhook_server.erl | 2 +- apps/emqx_gateway/README.md | 4 ++-- apps/emqx_gateway/etc/emqx_gateway.conf.example | 12 ++++++------ apps/emqx_gateway/include/emqx_gateway.hrl | 2 +- .../src/bhvrs/emqx_gateway_channel.erl | 2 +- .../emqx_gateway/src/bhvrs/emqx_gateway_conn.erl | 4 ++-- apps/emqx_gateway/src/coap/README.md | 4 ++-- apps/emqx_gateway/src/coap/emqx_coap_channel.erl | 4 ++-- apps/emqx_gateway/src/coap/emqx_coap_tm.erl | 2 +- .../src/emqx_gateway_api_clients.erl | 2 +- apps/emqx_gateway/src/emqx_gateway_cli.erl | 2 +- apps/emqx_gateway/src/emqx_gateway_cm.erl | 2 +- .../src/emqx_gateway_cm_registry.erl | 2 +- apps/emqx_gateway/src/emqx_gateway_insta_sup.erl | 2 +- apps/emqx_gateway/src/emqx_gateway_registry.erl | 2 +- apps/emqx_gateway/src/emqx_gateway_schema.erl | 4 ++-- apps/emqx_gateway/src/exproto/README.md | 2 +- .../src/exproto/emqx_exproto_gsvr.erl | 2 +- .../src/exproto/emqx_exproto_impl.erl | 2 +- .../src/exproto/protos/exproto.proto | 4 ++-- .../src/lwm2m/emqx_lwm2m_channel.erl | 8 ++++---- apps/emqx_gateway/src/lwm2m/emqx_lwm2m_tlv.erl | 2 +- apps/emqx_gateway/src/mqttsn/README.md | 4 ++-- apps/emqx_gateway/src/mqttsn/emqx_sn_channel.erl | 4 ++-- apps/emqx_gateway/src/mqttsn/emqx_sn_impl.erl | 2 +- apps/emqx_gateway/src/mqttsn/include/emqx_sn.hrl | 2 +- .../src/stomp/emqx_stomp_channel.erl | 4 ++-- .../emqx_gateway/test/emqx_gateway_cli_SUITE.erl | 6 +++--- apps/emqx_gateway/test/emqx_gateway_cm_SUITE.erl | 2 +- apps/emqx_gateway/test/emqx_lwm2m_SUITE.erl | 2 +- .../emqx_gateway/test/emqx_sn_protocol_SUITE.erl | 2 +- apps/emqx_gateway/test/emqx_stomp_SUITE.erl | 2 +- apps/emqx_machine/src/emqx_global_gc.erl | 2 +- apps/emqx_modules/src/emqx_modules_conf.erl | 2 +- apps/emqx_modules/src/emqx_topic_metrics_api.erl | 4 ++-- apps/emqx_plugins/src/emqx_plugins.erl | 2 +- apps/emqx_plugins/src/emqx_plugins_cli.erl | 2 +- apps/emqx_plugins/test/emqx_plugins_SUITE.erl | 2 +- apps/emqx_plugins/test/emqx_plugins_tests.erl | 2 +- apps/emqx_psk/src/emqx_psk.erl | 2 +- apps/emqx_resource/src/emqx_resource.erl | 2 +- .../src/emqx_resource_health_check.erl | 2 +- apps/emqx_retainer/README.md | 2 +- apps/emqx_retainer/src/emqx_retainer_api.erl | 2 +- .../src/emqx_rule_api_schema.erl | 2 +- .../src/emqx_rule_engine_schema.erl | 2 +- apps/emqx_rule_engine/src/emqx_rule_funcs.erl | 6 +++--- .../test/emqx_rule_funcs_SUITE.erl | 2 +- apps/emqx_slow_subs/src/emqx_slow_subs.erl | 2 +- bin/emqx | 10 +++++----- bin/nodetool | 2 +- deploy/docker/README.md | 8 ++++---- deploy/packages/rpm/Makefile | 2 +- rebar.config.erl | 2 +- scripts/apps-version-check.sh | 4 ++-- scripts/start-two-nodes-in-docker.sh | 2 +- scripts/update-copyright-years.sh | 2 +- scripts/update_appup.escript | 2 +- 97 files changed, 158 insertions(+), 158 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/assets/issue-handling.uml b/.github/ISSUE_TEMPLATE/assets/issue-handling.uml index d8fca7f95..b6ea30dc7 100644 --- a/.github/ISSUE_TEMPLATE/assets/issue-handling.uml +++ b/.github/ISSUE_TEMPLATE/assets/issue-handling.uml @@ -42,7 +42,7 @@ closed --> [*] accepted -down--> assigned: priority review -accepted --> needs_information: need more information\n to proceeed +accepted --> needs_information: need more information\n to proceed needs_information --> accepted: updates assigned --> InProgress: In sprint run\n or\n start to work on InProgress --> closed: issue is solved diff --git a/Windows.md b/Windows.md index 09bc7e950..25896129f 100644 --- a/Windows.md +++ b/Windows.md @@ -6,7 +6,7 @@ NOTE: The instructions and examples are based on Windows 10. ### Visual studio for C/C++ compile and link -EMQ X includes Erlang NIF (Native Implmented Function) components, implemented +EMQ X includes Erlang NIF (Native Implemented Function) components, implemented in C/C++. To compile and link C/C++ libraries, the easiest way is perhaps to install Visual Studio. @@ -58,7 +58,7 @@ environment in Windows, there are quite a few options. Cygwin is what we tested with. * Add `cygwin\bin` dir to `Path` environment variable - To do so, search for Edit environment variable in control pannel and + To do so, search for Edit environment variable in control panel and add `C:\tools\cygwin\bin` (depending on the location where it was installed) to `Path` list. @@ -107,8 +107,8 @@ scoop install git curl make cmake jq zip unzip variables are not set. Make sure `vcvarsall.bat x86_amd64` is executed prior to the `make` command * `link: extra operand 'some.obj'` - This is likely due ot the usage of GNU `lnik.exe` but not the one from Visual Studio. - Exeucte `link.exe --version` to inspect which one is in use. The one installed from + This is likely due to the usage of GNU `lnik.exe` but not the one from Visual Studio. + Execute `link.exe --version` to inspect which one is in use. The one installed from Visual Studio should print out `Microsoft (R) Incremental Linker`. To fix it, Visual Studio's bin paths should be ordered prior to Cygwin's (or similar installation's) bin paths in `Path` environment variable. diff --git a/apps/emqx/etc/emqx.conf b/apps/emqx/etc/emqx.conf index 0b877cf0b..179a6505d 100644 --- a/apps/emqx/etc/emqx.conf +++ b/apps/emqx/etc/emqx.conf @@ -896,7 +896,7 @@ conn_congestion { ## ## Sometimes the mqtt connection (usually an MQTT subscriber) may ## get "congested" because there're too many packets to sent. - ## The socket trys to buffer the packets until the buffer is + ## The socket tries to buffer the packets until the buffer is ## full. If more packets comes after that, the packets will be ## "pending" in a queue and we consider the connection is ## "congested". diff --git a/apps/emqx/src/emqx_authentication.erl b/apps/emqx/src/emqx_authentication.erl index ffde0114d..18798598e 100644 --- a/apps/emqx/src/emqx_authentication.erl +++ b/apps/emqx/src/emqx_authentication.erl @@ -120,7 +120,7 @@ atom() => term()}. %% @doc check_config takes raw config from config file, -%% parse and validate it, and reutrn parsed result. +%% parse and validate it, and return parsed result. -callback check_config(config()) -> config(). -callback create(AuthenticatorID, Config) diff --git a/apps/emqx/src/emqx_config.erl b/apps/emqx/src/emqx_config.erl index ab01a4b57..68e5d1e08 100644 --- a/apps/emqx/src/emqx_config.erl +++ b/apps/emqx/src/emqx_config.erl @@ -112,9 +112,9 @@ post_config_update => #{module() => any()} }. -%% raw_config() is the config that is NOT parsed and tranlated by hocon schema +%% raw_config() is the config that is NOT parsed and translated by hocon schema -type raw_config() :: #{binary() => term()} | list() | undefined. -%% config() is the config that is parsed and tranlated by hocon schema +%% config() is the config that is parsed and translated by hocon schema -type config() :: #{atom() => term()} | list() | undefined. -type app_envs() :: [proplists:property()]. diff --git a/apps/emqx/src/emqx_config_handler.erl b/apps/emqx/src/emqx_config_handler.erl index 8784fb096..ccb21cd59 100644 --- a/apps/emqx/src/emqx_config_handler.erl +++ b/apps/emqx/src/emqx_config_handler.erl @@ -70,7 +70,7 @@ stop() -> -spec update_config(module(), emqx_config:config_key_path(), emqx_config:update_args()) -> {ok, emqx_config:update_result()} | {error, emqx_config:update_error()}. update_config(SchemaModule, ConfKeyPath, UpdateArgs) -> - %% force covert 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], gen_server:call(?MODULE, {change_config, SchemaModule, AtomKeyPath, UpdateArgs}, infinity). diff --git a/apps/emqx/src/emqx_connection.erl b/apps/emqx/src/emqx_connection.erl index 46ce25d10..4fbfa1155 100644 --- a/apps/emqx/src/emqx_connection.erl +++ b/apps/emqx/src/emqx_connection.erl @@ -880,7 +880,7 @@ handle_cast(Req, State) -> -type check_succ_handler() :: fun((any(), list(any()), state()) -> _). -%% check limiters, if successed call WhenOk with Data and Msgs +%% check limiters, if succeeded call WhenOk with Data and Msgs %% Data is the data to be processed %% Msgs include the next msg which after Data processed -spec check_limiter(list({pos_integer(), limiter_type()}), diff --git a/apps/emqx/src/emqx_limiter/src/emqx_limiter.app.src b/apps/emqx/src/emqx_limiter/src/emqx_limiter.app.src index 3ad320849..33177492d 100644 --- a/apps/emqx/src/emqx_limiter/src/emqx_limiter.app.src +++ b/apps/emqx/src/emqx_limiter/src/emqx_limiter.app.src @@ -1,6 +1,6 @@ %% -*- mode: erlang -*- {application, emqx_limiter, - [{description, "EMQ X Hierachical Limiter"}, + [{description, "EMQ X Hierarchical Limiter"}, {vsn, "1.0.0"}, % strict semver, bump manually! {modules, []}, {registered, [emqx_limiter_sup]}, diff --git a/apps/emqx/src/emqx_limiter/src/emqx_limiter_server.erl b/apps/emqx/src/emqx_limiter/src/emqx_limiter_server.erl index 1bccbf2a0..32cbd29b2 100644 --- a/apps/emqx/src/emqx_limiter/src/emqx_limiter_server.erl +++ b/apps/emqx/src/emqx_limiter/src/emqx_limiter_server.erl @@ -338,11 +338,11 @@ longitudinal(#{id := Id, end, case lists:min([ShouldAlloc, Flow, Capacity]) of - Avaiable when Avaiable > 0 -> + Available when Available > 0 -> %% XXX if capacity is infinity, and flow always > 0, the value in %% counter will be overflow at some point in the future, do we need %% to deal with this situation??? - {Inc, Node2} = emqx_limiter_correction:add(Avaiable, Node), + {Inc, Node2} = emqx_limiter_correction:add(Available, Node), counters:add(Counter, Index, Inc), {Inc, diff --git a/apps/emqx/src/emqx_olp.erl b/apps/emqx/src/emqx_olp.erl index ee0a0cf5f..9c1794815 100644 --- a/apps/emqx/src/emqx_olp.erl +++ b/apps/emqx/src/emqx_olp.erl @@ -53,7 +53,7 @@ is_overloaded() -> %% @doc Backoff with a delay if the system is overloaded, for tasks that could be deferred. %% returns `false' if backoff didn't happen, the system is cool. %% returns `ok' if backoff is triggered and get unblocked when the system is cool. -%% returns `timeout' if backoff is trigged but get unblocked due to timeout as configured. +%% returns `timeout' if backoff is triggered but get unblocked due to timeout as configured. -spec backoff(Zone :: atom()) -> ok | false | timeout. backoff(Zone) -> case emqx_config:get_zone_conf(Zone, [?overload_protection]) of @@ -96,12 +96,12 @@ backoff_new_conn(Zone) -> status() -> is_overloaded(). -%% @doc turn off backgroud runq check. +%% @doc turn off background runq check. -spec disable() -> ok | {error, timeout}. disable() -> load_ctl:stop_runq_flagman(5000). -%% @doc turn on backgroud runq check. +%% @doc turn on background runq check. -spec enable() -> {ok, pid()} | {error, running | restarting | disabled}. enable() -> case load_ctl:restart_runq_flagman() of diff --git a/apps/emqx/src/emqx_pqueue.erl b/apps/emqx/src/emqx_pqueue.erl index 5dd81af0b..c2e475b0a 100644 --- a/apps/emqx/src/emqx_pqueue.erl +++ b/apps/emqx/src/emqx_pqueue.erl @@ -33,7 +33,7 @@ %% When the queue contains items with non-zero priorities, it is %% represented as a sorted kv list with the inverted Priority as the %% key and an ordinary queue as the value. Here again we use our own -%% ordinary queue implemention for efficiency, often making recursive +%% ordinary queue implementation for efficiency, often making recursive %% calls into the same function knowing that ordinary queues represent %% a base case. diff --git a/apps/emqx/src/emqx_release.erl b/apps/emqx/src/emqx_release.erl index 2ff3fca81..ac7c7256b 100644 --- a/apps/emqx/src/emqx_release.erl +++ b/apps/emqx/src/emqx_release.erl @@ -70,7 +70,7 @@ edition(Desc) -> %% @doc Return the release version. version() -> case lists:keyfind(emqx_vsn, 1, ?MODULE:module_info(compile)) of - false -> %% For TEST build or depedency build. + false -> %% For TEST build or dependency build. build_vsn(); {_, Vsn} -> %% For emqx release build VsnStr = build_vsn(), diff --git a/apps/emqx/src/emqx_schema.erl b/apps/emqx/src/emqx_schema.erl index 935bef979..e9000c449 100644 --- a/apps/emqx/src/emqx_schema.erl +++ b/apps/emqx/src/emqx_schema.erl @@ -107,7 +107,7 @@ and can not be deleted.""" sc(ref("mqtt"), #{ desc => """Global MQTT configuration.
-The configs here work as default values which can be overriden +The configs here work as default values which can be overridden in zone configs""" })} , {?EMQX_AUTHENTICATION_CONFIG_ROOT_NAME, @@ -1045,7 +1045,7 @@ when deactivated, but after the retention time. fields("latency_stats") -> [ {"samples", sc(integer(), #{default => 10, - desc => "the number of smaples for calculate the average latency of delivery"})} + desc => "the number of samples for calculate the average latency of delivery"})} ]; fields("trace") -> [ {"payload_encode", sc(hoconsc:enum([hex, text, hidden]), #{ diff --git a/apps/emqx/src/emqx_session.erl b/apps/emqx/src/emqx_session.erl index f5c9e0e1e..479f4f1b2 100644 --- a/apps/emqx/src/emqx_session.erl +++ b/apps/emqx/src/emqx_session.erl @@ -119,14 +119,14 @@ mqueue :: emqx_mqueue:mqueue(), %% Next packet id of the session next_pkt_id = 1 :: emqx_types:packet_id(), - %% Retry interval for redelivering QoS1/2 messages (Unit: millsecond) + %% Retry interval for redelivering QoS1/2 messages (Unit: millisecond) retry_interval :: timeout(), %% Client -> Broker: QoS2 messages received from the client, but %% have not been completely acknowledged awaiting_rel :: map(), %% Maximum number of awaiting QoS2 messages allowed max_awaiting_rel :: non_neg_integer() | infinity, - %% Awaiting PUBREL Timeout (Unit: millsecond) + %% Awaiting PUBREL Timeout (Unit: millisecond) await_rel_timeout :: timeout(), %% Created at created_at :: pos_integer(), diff --git a/apps/emqx/src/emqx_tls_lib.erl b/apps/emqx/src/emqx_tls_lib.erl index ca8578126..ef3e80e1f 100644 --- a/apps/emqx/src/emqx_tls_lib.erl +++ b/apps/emqx/src/emqx_tls_lib.erl @@ -310,7 +310,7 @@ is_valid_string(Binary) when is_binary(Binary) -> _Otherwise -> false end. -%% Check if it is a valid PEM formated key. +%% Check if it is a valid PEM formatted key. is_pem(MaybePem) -> try public_key:pem_decode(MaybePem) =/= [] catch _ : _ -> false diff --git a/apps/emqx/src/emqx_trie.erl b/apps/emqx/src/emqx_trie.erl index 2ab96f988..52cc76ecc 100644 --- a/apps/emqx/src/emqx_trie.erl +++ b/apps/emqx/src/emqx_trie.erl @@ -136,7 +136,7 @@ delete(Topic, Trie) when is_binary(Topic) -> false -> ok end. -%% @doc Find trie nodes that matchs the topic name. +%% @doc Find trie nodes that matches the topic name. -spec(match(emqx_types:topic()) -> list(emqx_types:topic())). match(Topic) when is_binary(Topic) -> match(Topic, ?TRIE). diff --git a/apps/emqx/test/emqx_logger_SUITE.erl b/apps/emqx/test/emqx_logger_SUITE.erl index 897932da1..85afcb655 100644 --- a/apps/emqx/test/emqx_logger_SUITE.erl +++ b/apps/emqx/test/emqx_logger_SUITE.erl @@ -114,7 +114,7 @@ t_start_stop_log_handler2(_) -> %% stop a no exists handler returns {not_started, Id} ?assertMatch({error, {not_started, invalid_handler_id}}, ?LOGGER:stop_log_handler(invalid_handler_id)), - %% stop a handler that is already stopped retuns {not_started, Id} + %% stop a handler that is already stopped returns {not_started, Id} ok = ?LOGGER:stop_log_handler(default), ?assertMatch({error, {not_started, default}}, ?LOGGER:stop_log_handler(default)). diff --git a/apps/emqx/test/emqx_ratelimiter_SUITE.erl b/apps/emqx/test/emqx_ratelimiter_SUITE.erl index c26c82aaf..be89e332a 100644 --- a/apps/emqx/test/emqx_ratelimiter_SUITE.erl +++ b/apps/emqx/test/emqx_ratelimiter_SUITE.erl @@ -563,7 +563,7 @@ client_try_check(Need, #client{counter = Counter, %% XXX not a god test, because client's rate maybe bigger than global rate %% so if client' rate = infinity -%% client's divisible should be true or capacity must be bigger than number of each comsume +%% client's divisible should be true or capacity must be bigger than number of each consume client_random_val(infinity) -> 1000; diff --git a/apps/emqx/test/emqx_request_responser_SUITE.erl b/apps/emqx/test/emqx_request_responser_SUITE.erl index 00020565c..c98a6cc7f 100644 --- a/apps/emqx/test/emqx_request_responser_SUITE.erl +++ b/apps/emqx/test/emqx_request_responser_SUITE.erl @@ -49,9 +49,9 @@ request_response_per_qos(QoS) -> I = b2i(ReqBin), i2b(I * I) end, - {ok, Responser} = emqx_request_handler:start_link(ReqTopic, QoS, Square, + {ok, Responder} = emqx_request_handler:start_link(ReqTopic, QoS, Square, [{proto_ver, v5}, - {clientid, <<"responser">>} + {clientid, <<"responder">>} ]), ok = emqx_request_sender:send(Requester, ReqTopic, RspTopic, <<"corr-1">>, <<"2">>, QoS), receive @@ -64,7 +64,7 @@ request_response_per_qos(QoS) -> erlang:error(timeout) end, ok = emqx_request_sender:stop(Requester), - ok = emqx_request_handler:stop(Responser). + ok = emqx_request_handler:stop(Responder). b2i(B) -> binary_to_integer(B). i2b(I) -> integer_to_binary(I). diff --git a/apps/emqx/test/emqx_takeover_SUITE.erl b/apps/emqx/test/emqx_takeover_SUITE.erl index 010a23a56..4ef008edd 100644 --- a/apps/emqx/test/emqx_takeover_SUITE.erl +++ b/apps/emqx/test/emqx_takeover_SUITE.erl @@ -27,7 +27,7 @@ -define(CNT, 100). %%-------------------------------------------------------------------- -%% Inital funcs +%% Initial funcs all() -> emqx_common_test_helpers:all(?MODULE). diff --git a/apps/emqx/test/props/prop_emqx_json.erl b/apps/emqx/test/props/prop_emqx_json.erl index 7683a4687..20293ab6b 100644 --- a/apps/emqx/test/props/prop_emqx_json.erl +++ b/apps/emqx/test/props/prop_emqx_json.erl @@ -68,7 +68,7 @@ prop_object_map_to_map() -> true end). -%% The duplicated key will be overriden +%% The duplicated key will be overridden prop_object_proplist_to_map() -> ?FORALL(T0, json_object(), begin diff --git a/apps/emqx_authn/src/emqx_authn_api.erl b/apps/emqx_authn/src/emqx_authn_api.erl index f59dad701..3219640d4 100644 --- a/apps/emqx_authn/src/emqx_authn_api.erl +++ b/apps/emqx_authn/src/emqx_authn_api.erl @@ -974,7 +974,7 @@ authenticator_examples() -> } }, 'password-based:http' => #{ - summary => <<"Password-based authentication througth external HTTP API">>, + summary => <<"Password-based authentication through external HTTP API">>, value => #{ mechanism => <<"password-based">>, backend => <<"http">>, diff --git a/apps/emqx_authn/src/emqx_authn_schema.erl b/apps/emqx_authn/src/emqx_authn_schema.erl index 03773ff41..b2573977d 100644 --- a/apps/emqx_authn/src/emqx_authn_schema.erl +++ b/apps/emqx_authn/src/emqx_authn_schema.erl @@ -46,9 +46,9 @@ authenticator_type() -> config_refs(Modules) -> lists:append([Module:refs() || Module <- Modules]). -%% authn is a core functionality however implemented outside fo emqx app +%% authn is a core functionality however implemented outside of emqx app %% in emqx_schema, 'authentication' is a map() type which is to allow -%% EMQ X more plugable. +%% EMQ X more pluggable. root_type() -> hoconsc:array(authenticator_type()). diff --git a/apps/emqx_authn/test/emqx_authn_mongo_tls_SUITE.erl b/apps/emqx_authn/test/emqx_authn_mongo_tls_SUITE.erl index fb83c5b77..73cdd6a53 100644 --- a/apps/emqx_authn/test/emqx_authn_mongo_tls_SUITE.erl +++ b/apps/emqx_authn/test/emqx_authn_mongo_tls_SUITE.erl @@ -63,7 +63,7 @@ end_per_suite(_Config) -> %% Tests %%------------------------------------------------------------------------------ -%% emqx_connector_mongo connects asyncronously, +%% emqx_connector_mongo connects asynchronously, %% so we check failure/success indirectly (through snabbkaffe). %% openssl s_client -tls1_2 -cipher ECDHE-RSA-AES256-GCM-SHA384 \ diff --git a/apps/emqx_authz/src/emqx_authz.erl b/apps/emqx_authz/src/emqx_authz.erl index 97e589723..5ad8eb6f7 100644 --- a/apps/emqx_authz/src/emqx_authz.erl +++ b/apps/emqx_authz/src/emqx_authz.erl @@ -362,7 +362,7 @@ type(postgresql) -> postgresql; type(<<"postgresql">>) -> postgresql; type('built-in-database') -> 'built-in-database'; type(<<"built-in-database">>) -> 'built-in-database'; -%% should never happend if the input is type-checked by hocon schema +%% should never happen if the input is type-checked by hocon schema type(Unknown) -> error({unknown_authz_source_type, Unknown}). %% @doc where the acl.conf file is stored. diff --git a/apps/emqx_authz/src/emqx_authz_schema.erl b/apps/emqx_authz/src/emqx_authz_schema.erl index 5b005d3aa..682d68481 100644 --- a/apps/emqx_authz/src/emqx_authz_schema.erl +++ b/apps/emqx_authz/src/emqx_authz_schema.erl @@ -76,7 +76,7 @@ ordered to form a chain of access controls.
When authorizing a publish or subscribe action, the configured sources are checked in order. When checking an ACL source, in case the client (identified by username or client ID) is not found, -it moves on to the next source. And it stops immediatly +it moves on to the next source. And it stops immediately once an 'allow' or 'deny' decision is returned.
If the client is not found in any of the sources, diff --git a/apps/emqx_conf/etc/emqx_conf.conf b/apps/emqx_conf/etc/emqx_conf.conf index ee869f3a3..f9a3bbd94 100644 --- a/apps/emqx_conf/etc/emqx_conf.conf +++ b/apps/emqx_conf/etc/emqx_conf.conf @@ -230,7 +230,7 @@ cluster { ## Cluster using etcd ##---------------------------------------------------------------- etcd { - ## Etcd server list, seperated by ','. + ## Etcd server list, separated by ','. ## ## @doc cluster.etcd.server ## ValueType: URL @@ -279,7 +279,7 @@ cluster { ## Cluster using Kubernetes ##---------------------------------------------------------------- k8s { - ## Kubernetes API server list, seperated by ','. + ## Kubernetes API server list, separated by ','. ## ## @doc cluster.k8s.apiserver ## ValueType: URL @@ -459,7 +459,7 @@ log { ## Default: true overload_kill.enable = true - ## The max allowed queue length before killing the log hanlder. + ## The max allowed queue length before killing the log handler. ## ## Log overload protection parameter. This is the maximum allowed queue ## length. If the message queue grows larger than this, the handler @@ -471,7 +471,7 @@ log { ## Default: 20000 overload_kill.qlen = 20000 - ## The max allowed memory size before killing the log hanlder. + ## The max allowed memory size before killing the log handler. ## ## Log overload protection parameter. This is the maximum memory size ## that the handler process is allowed to use. If the handler grows @@ -482,7 +482,7 @@ log { ## Default: 30MB overload_kill.mem_size = 30MB - ## Restart the log hanlder after some seconds. + ## Restart the log handler after some seconds. ## ## Log overload protection parameter. If the handler is terminated, ## it restarts automatically after a delay specified in seconds. @@ -669,7 +669,7 @@ log { ## Default: true overload_kill.enable = true - ## The max allowed queue length before killing the log hanlder. + ## The max allowed queue length before killing the log handler. ## ## Log overload protection parameter. This is the maximum allowed queue ## length. If the message queue grows larger than this, the handler @@ -681,7 +681,7 @@ log { ## Default: 20000 overload_kill.qlen = 20000 - ## The max allowed memory size before killing the log hanlder. + ## The max allowed memory size before killing the log handler. ## ## Log overload protection parameter. This is the maximum memory size ## that the handler process is allowed to use. If the handler grows @@ -692,7 +692,7 @@ log { ## Default: 30MB overload_kill.mem_size = 30MB - ## Restart the log hanlder after some seconds. + ## Restart the log handler after some seconds. ## ## Log overload protection parameter. If the handler is terminated, ## it restarts automatically after a delay specified in seconds. diff --git a/apps/emqx_conf/etc/emqx_conf.md b/apps/emqx_conf/etc/emqx_conf.md index 1d60de568..75972b7fc 100644 --- a/apps/emqx_conf/etc/emqx_conf.md +++ b/apps/emqx_conf/etc/emqx_conf.md @@ -58,7 +58,7 @@ There are 4 complex data types in EMQ X's HOCON config: 1. Struct: Named using an unquoted string, followed by a pre-defined list of fields, fields can not start with a number, and are only allowed to use - lowercase letters and underscores as word separater. + lowercase letters and underscores as word separator. 1. Map: Map is like Struct, however the fields are not pre-defined. 1-based index number can also be used as map keys for an alternative representation of an Array. @@ -67,7 +67,7 @@ There are 4 complex data types in EMQ X's HOCON config: ### Primitive Data Types -Complex types define data 'boxes' wich may contain other complex data +Complex types define data 'boxes' which may contain other complex data or primitive values. There are quite some different primitive types, to name a fiew: @@ -82,7 +82,7 @@ There are quite some different primitive types, to name a fiew: * ... The primitive types are mostly self-describing, some are built-in, such -as `atom()`, some are defiend in EMQ X modules, such as `emqx_schema:duration()`. +as `atom()`, some are defined in EMQ X modules, such as `emqx_schema:duration()`. ### Config Paths @@ -133,14 +133,14 @@ because the field name is `enable`, not `enabled`. ### Config overlay rules -HOCON objects are overlayed, in general: +HOCON objects are overlaid, in general: - Within one file, objects defined 'later' recursively override objects defined 'earlier' - When layered, 'later' (hihger lalyer) objects override objects defined 'earlier' (lower layer) Below are more detailed rules. -#### Struct Fileds +#### Struct Fields Later config values overwrites earlier values. For example, in below config, the last line `debug` overwrites `errro` for @@ -171,7 +171,7 @@ zone { } ## The maximum packet size can be defined as above, -## then overriden as below +## then overridden as below zone.zone1.mqtt.max_packet_size = 10M ``` diff --git a/apps/emqx_conf/src/emqx_conf_schema.erl b/apps/emqx_conf/src/emqx_conf_schema.erl index a916d3a25..ebba3e938 100644 --- a/apps/emqx_conf/src/emqx_conf_schema.erl +++ b/apps/emqx_conf/src/emqx_conf_schema.erl @@ -328,7 +328,7 @@ Select the backend for the embedded database.
Important! This setting should be the same on all nodes in the cluster.
Important! Changing this setting in the runtime is not allowed.
mnesia is the default backend, that offers decent performance in small clusters.
-rlog is a new experimantal backend that is suitable for very large clusters. +rlog is a new experimental backend that is suitable for very large clusters. """ })} , {"role", @@ -836,7 +836,7 @@ emqx_schema_high_prio_roots() -> sc(hoconsc:ref("authorization"), #{ desc => """ Authorization a.k.a ACL.
-In EMQ X, MQTT client access control is extremly flexible.
+In EMQ X, MQTT client access control is extremely flexible.
An out of the box set of authorization data sources are supported. For example,
'file' source is to support concise and yet generic ACL rules in a file;
diff --git a/apps/emqx_connector/src/emqx_connector_http.erl b/apps/emqx_connector/src/emqx_connector_http.erl index 37f7b4321..94be5bba9 100644 --- a/apps/emqx_connector/src/emqx_connector_http.erl +++ b/apps/emqx_connector/src/emqx_connector_http.erl @@ -91,7 +91,7 @@ For example: http://localhost:9901/ , {pool_type, sc(pool_type(), #{ default => random - , desc => "The type of the pool. Canbe one of random, hash" + , desc => "The type of the pool. Can be one of random, hash" })} , {pool_size, sc(non_neg_integer(), @@ -216,12 +216,12 @@ on_query(InstId, {KeyOrNum, Method, Request, Timeout}, AfterQuery, {ok, StatusCode, _, _} when StatusCode >= 200 andalso StatusCode < 300 -> emqx_resource:query_success(AfterQuery); {ok, StatusCode, _} -> - ?SLOG(error, #{msg => "http connector do reqeust, received error response", + ?SLOG(error, #{msg => "http connector do request, received error response", request => NRequest, connector => InstId, status_code => StatusCode}), emqx_resource:query_failed(AfterQuery); {ok, StatusCode, _, _} -> - ?SLOG(error, #{msg => "http connector do reqeust, received error response", + ?SLOG(error, #{msg => "http connector do request, received error response", request => NRequest, connector => InstId, status_code => StatusCode}), emqx_resource:query_failed(AfterQuery) diff --git a/apps/emqx_connector/src/mqtt/emqx_connector_mqtt_mod.erl b/apps/emqx_connector/src/mqtt/emqx_connector_mqtt_mod.erl index 5cc6c7796..f02836b22 100644 --- a/apps/emqx_connector/src/mqtt/emqx_connector_mqtt_mod.erl +++ b/apps/emqx_connector/src/mqtt/emqx_connector_mqtt_mod.erl @@ -148,7 +148,7 @@ send(#{client_pid := ClientPid} = Conn, [Msg | Rest], PktIds) -> {ok, PktId} -> send(Conn, Rest, [PktId | PktIds]); {error, Reason} -> - %% NOTE: There is no partial sucess of a batch and recover from the middle + %% NOTE: There is no partial success of a batch and recover from the middle %% only to retry all messages in one batch {error, Reason} end. diff --git a/apps/emqx_connector/src/mqtt/emqx_connector_mqtt_schema.erl b/apps/emqx_connector/src/mqtt/emqx_connector_mqtt_schema.erl index 75e7c8d05..b42b10bf0 100644 --- a/apps/emqx_connector/src/mqtt/emqx_connector_mqtt_schema.erl +++ b/apps/emqx_connector/src/mqtt/emqx_connector_mqtt_schema.erl @@ -48,7 +48,7 @@ The mode of the MQTT Bridge. Can be one of 'cluster_singleton' or 'cluster_share In 'cluster_singleton' node, all messages toward the remote broker go through the same MQTT connection.
- cluster_shareload: create an MQTT connection on each node in the emqx cluster.
-In 'cluster_shareload' mode, the incomming load from the remote broker is shared by +In 'cluster_shareload' mode, the incoming load from the remote broker is shared by using shared subscription.
Note that the 'clientid' is suffixed by the node name, this is to avoid clientid conflicts between different nodes. And we can only use shared subscription diff --git a/apps/emqx_connector/src/mqtt/emqx_connector_mqtt_worker.erl b/apps/emqx_connector/src/mqtt/emqx_connector_mqtt_worker.erl index 792cb8823..184c112ed 100644 --- a/apps/emqx_connector/src/mqtt/emqx_connector_mqtt_worker.erl +++ b/apps/emqx_connector/src/mqtt/emqx_connector_mqtt_worker.erl @@ -45,7 +45,7 @@ %% %% (0): auto or manual start %% (1): retry timeout -%% (2): successfuly connected to remote node/cluster +%% (2): successfully connected to remote node/cluster %% (3): received {disconnected, Reason} OR %% failed to send to remote node/cluster. %% @@ -53,7 +53,7 @@ %% local topics, and the underlying `emqx_bridge_connect' may subscribe to %% multiple remote topics, however, worker/connections are not designed %% to support automatic load-balancing, i.e. in case it can not keep up -%% with the amount of messages comming in, administrator should split and +%% with the amount of messages coming in, administrator should split and %% balance topics between worker/connections manually. %% %% NOTES: diff --git a/apps/emqx_connector/test/emqx_connector_mqtt_worker_tests.erl b/apps/emqx_connector/test/emqx_connector_mqtt_worker_tests.erl index 7957b6d54..cf1a190d4 100644 --- a/apps/emqx_connector/test/emqx_connector_mqtt_worker_tests.erl +++ b/apps/emqx_connector/test/emqx_connector_mqtt_worker_tests.erl @@ -128,7 +128,7 @@ manual_start_stop_test() -> Config0 = make_config(Ref, TestPid, {ok, #{client_pid => TestPid}}), Config = Config0#{start_type := manual}, {ok, Pid} = emqx_connector_mqtt_worker:start_link(Config#{name => BridgeName}), - %% call ensure_started again should yeld the same result + %% call ensure_started again should yield the same result ok = emqx_connector_mqtt_worker:ensure_started(BridgeName), emqx_connector_mqtt_worker:ensure_stopped(BridgeName), emqx_metrics:stop(), diff --git a/apps/emqx_dashboard/README.md b/apps/emqx_dashboard/README.md index c86765c51..260cd5081 100644 --- a/apps/emqx_dashboard/README.md +++ b/apps/emqx_dashboard/README.md @@ -54,7 +54,7 @@ Build make && make ct -Configurtion +Configuration ------------ ``` diff --git a/apps/emqx_dashboard/src/emqx_dashboard_schema.erl b/apps/emqx_dashboard/src/emqx_dashboard_schema.erl index fddf8ca62..957d1e2da 100644 --- a/apps/emqx_dashboard/src/emqx_dashboard_schema.erl +++ b/apps/emqx_dashboard/src/emqx_dashboard_schema.erl @@ -61,7 +61,7 @@ default_password(nullable) -> false; default_password(sensitive) -> true; default_password(desc) -> """ The initial default password for dashboard 'admin' user. -For safty, it should be changed as soon as possible."""; +For safety, it should be changed as soon as possible."""; default_password(_) -> undefined. cors(type) -> boolean(); diff --git a/apps/emqx_dashboard/src/emqx_dashboard_swagger.erl b/apps/emqx_dashboard/src/emqx_dashboard_swagger.erl index 802bde288..27539683a 100644 --- a/apps/emqx_dashboard/src/emqx_dashboard_swagger.erl +++ b/apps/emqx_dashboard/src/emqx_dashboard_swagger.erl @@ -481,7 +481,7 @@ typename_to_spec(Name, Mod) -> Spec2 = typerefl_array(Spec1, Name, Mod), Spec3 = integer(Spec2, Name), Spec3 =:= nomatch andalso - throw({error, #{msg => <<"Unsupport Type">>, type => Name, module => Mod}}), + throw({error, #{msg => <<"Unsupported Type">>, type => Name, module => Mod}}), Spec3. range(Name) -> diff --git a/apps/emqx_exhook/README.md b/apps/emqx_exhook/README.md index 216c39275..6933fc747 100644 --- a/apps/emqx_exhook/README.md +++ b/apps/emqx_exhook/README.md @@ -1,6 +1,6 @@ # emqx_exhook -The `emqx_exhook` extremly enhance the extensibility for EMQ X. It allow using an others programming language to mount the hooks intead of erlang. +The `emqx_exhook` extremely enhance the extensibility for EMQ X. It allow using an others programming language to mount the hooks instead of erlang. ## Feature diff --git a/apps/emqx_exhook/priv/protos/exhook.proto b/apps/emqx_exhook/priv/protos/exhook.proto index d77938494..33ceed869 100644 --- a/apps/emqx_exhook/priv/protos/exhook.proto +++ b/apps/emqx_exhook/priv/protos/exhook.proto @@ -236,10 +236,10 @@ message EmptySuccess { } message ValuedResponse { - // The responsed value type - // - contiune: Use the responsed value and execute the next hook - // - ignore: Ignore the responsed value - // - stop_and_return: Use the responsed value and stop the chain executing + // The responded value type + // - contiune: Use the responded value and execute the next hook + // - ignore: Ignore the responded value + // - stop_and_return: Use the responded value and stop the chain executing enum ResponsedType { CONTINUE = 0; diff --git a/apps/emqx_exhook/src/emqx_exhook_server.erl b/apps/emqx_exhook/src/emqx_exhook_server.erl index 9821f739b..19fd7ab5b 100644 --- a/apps/emqx_exhook/src/emqx_exhook_server.erl +++ b/apps/emqx_exhook/src/emqx_exhook_server.erl @@ -94,7 +94,7 @@ load(Name, #{request_timeout := Timeout, failed_action := FailedAction} = Opts) {ok, _ChannPoolPid} -> case do_init(Name, ReqOpts) of {ok, HookSpecs} -> - %% Reigster metrics + %% Register metrics Prefix = lists:flatten(io_lib:format("exhook.~ts.", [Name])), ensure_metrics(Prefix, HookSpecs), %% Ensure hooks diff --git a/apps/emqx_gateway/README.md b/apps/emqx_gateway/README.md index 4d39190c8..0067df2b8 100644 --- a/apps/emqx_gateway/README.md +++ b/apps/emqx_gateway/README.md @@ -4,7 +4,7 @@ ## Concept - EMQ X Gateway Managment + EMQ X Gateway Management - Gateway-Registry (or Gateway Type) - *Load - *UnLoad @@ -317,7 +317,7 @@ emqx_ctl gateway-banned emqx_ctl gateway-metrics [] ``` -#### Mangement by HTTP-API/Dashboard/ +#### Management by HTTP-API/Dashboard/ #### How to integrate a protocol to your platform diff --git a/apps/emqx_gateway/etc/emqx_gateway.conf.example b/apps/emqx_gateway/etc/emqx_gateway.conf.example index 49977c473..481a5c7cd 100644 --- a/apps/emqx_gateway/etc/emqx_gateway.conf.example +++ b/apps/emqx_gateway/etc/emqx_gateway.conf.example @@ -9,7 +9,7 @@ gateway.stomp { idle_timeout = 30s ## To control whether write statistics data into ETS table - ## for dashbord to read. + ## for dashboard to read. enable_stats = true ## When publishing or subscribing, prefix all topics with a mountpoint string. @@ -93,7 +93,7 @@ gateway.coap { idle_timeout = 30s ## To control whether write statistics data into ETS table - ## for dashbord to read. + ## for dashboard to read. enable_stats = true ## When publishing or subscribing, prefix all topics with a mountpoint string. @@ -112,7 +112,7 @@ gateway.coap { ## The type of delivered coap message can be set to: ## - non: Non-confirmable ## - con: Confirmable - ## - qos: Mapping from QoS type of the recevied message. + ## - qos: Mapping from QoS type of the received message. ## QoS0 -> non, QoS1,2 -> con. ## ## Enum: non | con | qos @@ -184,7 +184,7 @@ gateway.mqttsn { idle_timeout = 30s ## To control whether write statistics data into ETS table - ## for dashbord to read. + ## for dashboard to read. enable_stats = true ## When publishing or subscribing, prefix all topics with a mountpoint string. @@ -252,7 +252,7 @@ gateway.lwm2m { idle_timeout = 30s ## To control whether write statistics data into ETS table - ## for dashbord to read. + ## for dashboard to read. enable_stats = true ## When publishing or subscribing, prefix all topics with a mountpoint string. @@ -313,7 +313,7 @@ gateway.exproto { idle_timeout = 30s ## To control whether write statistics data into ETS table - ## for dashbord to read. + ## for dashboard to read. enable_stats = true ## When publishing or subscribing, prefix all topics with a mountpoint string. diff --git a/apps/emqx_gateway/include/emqx_gateway.hrl b/apps/emqx_gateway/include/emqx_gateway.hrl index 1ad201d7a..de6ecc97f 100644 --- a/apps/emqx_gateway/include/emqx_gateway.hrl +++ b/apps/emqx_gateway/include/emqx_gateway.hrl @@ -19,7 +19,7 @@ -type gateway_name() :: atom(). -%% @doc The Gateway defination +%% @doc The Gateway definition -type gateway() :: #{ name := gateway_name() %% Description diff --git a/apps/emqx_gateway/src/bhvrs/emqx_gateway_channel.erl b/apps/emqx_gateway/src/bhvrs/emqx_gateway_channel.erl index f172c4237..1f4a192d4 100644 --- a/apps/emqx_gateway/src/bhvrs/emqx_gateway_channel.erl +++ b/apps/emqx_gateway/src/bhvrs/emqx_gateway_channel.erl @@ -25,7 +25,7 @@ %%-------------------------------------------------------------------- %% Info & Stats -%% @doc Get the channel detailed infomation. +%% @doc Get the channel detailed information. -callback info(channel()) -> emqx_types:infos(). -callback info(Key :: atom() | [atom()], channel()) -> any(). diff --git a/apps/emqx_gateway/src/bhvrs/emqx_gateway_conn.erl b/apps/emqx_gateway/src/bhvrs/emqx_gateway_conn.erl index 8e0c3d7ba..c59f37e04 100644 --- a/apps/emqx_gateway/src/bhvrs/emqx_gateway_conn.erl +++ b/apps/emqx_gateway/src/bhvrs/emqx_gateway_conn.erl @@ -14,7 +14,7 @@ %% limitations under the License. %%-------------------------------------------------------------------- -%% @doc The behavior abstrat for TCP based gateway conn +%% @doc The behavior abstract for TCP based gateway conn -module(emqx_gateway_conn). -include_lib("emqx/include/types.hrl"). @@ -837,7 +837,7 @@ activate_socket(State = #state{sockstate = blocked}) -> activate_socket(State = #state{socket = Socket, active_n = N}) -> %% FIXME: Works on dtls/udp ??? - %% How to hanlde buffer? + %% How to handle buffer? case esockd_setopts(Socket, [{active, N}]) of ok -> {ok, State#state{sockstate = running}}; Error -> Error diff --git a/apps/emqx_gateway/src/coap/README.md b/apps/emqx_gateway/src/coap/README.md index 54f0fde84..a1662129e 100644 --- a/apps/emqx_gateway/src/coap/README.md +++ b/apps/emqx_gateway/src/coap/README.md @@ -133,7 +133,7 @@ The server manages the client through the ClientId. If the ClientId is wrong, EM - clientid := client uid - token - Resonse: + Response: - 2.01 "Deleted" when success - 4.00 "Bad Request" when error @@ -303,7 +303,7 @@ CoAP gateway uses some options in query string to conversion between MQTT CoAP. 2. Session - Manager the "Transport Manager" "Observe Resouces Manger" and next message id + Manager the "Transport Manager" "Observe Resources Manager" and next message id 3. Transport Mnager diff --git a/apps/emqx_gateway/src/coap/emqx_coap_channel.erl b/apps/emqx_gateway/src/coap/emqx_coap_channel.erl index 005342e09..cc5732ee2 100644 --- a/apps/emqx_gateway/src/coap/emqx_coap_channel.erl +++ b/apps/emqx_gateway/src/coap/emqx_coap_channel.erl @@ -244,7 +244,7 @@ handle_call({subscribe, Topic, SubOpts}, _From, _ = run_hooks(Ctx, 'session.subscribed', [ClientInfo, MountedTopic, NSubOpts]), - %% modifty session state + %% modify session state SubReq = {Topic, Token}, TempMsg = #coap_message{type = non}, %% FIXME: The subopts is not used for emqx_coap_session @@ -264,7 +264,7 @@ handle_call({unsubscribe, Topic}, _From, _ = run_hooks(Ctx, 'session.unsubscribe', [ClientInfo, MountedTopic, #{}]), - %% modifty session state + %% modify session state UnSubReq = Topic, TempMsg = #coap_message{type = non}, Result = emqx_coap_session:process_subscribe( diff --git a/apps/emqx_gateway/src/coap/emqx_coap_tm.erl b/apps/emqx_gateway/src/coap/emqx_coap_tm.erl index fead4d845..2b28f2723 100644 --- a/apps/emqx_gateway/src/coap/emqx_coap_tm.erl +++ b/apps/emqx_gateway/src/coap/emqx_coap_tm.erl @@ -66,7 +66,7 @@ outgoing => coap_message(), timeouts => list(ttimeout()), has_sub => undefined | sub_register(), - transport => emqx_coap_transport:transprot()}. + transport => emqx_coap_transport:transport()}. -define(TOKEN_ID(T), {token, T}). diff --git a/apps/emqx_gateway/src/emqx_gateway_api_clients.erl b/apps/emqx_gateway/src/emqx_gateway_api_clients.erl index eddd25853..4ea1b9589 100644 --- a/apps/emqx_gateway/src/emqx_gateway_api_clients.erl +++ b/apps/emqx_gateway/src/emqx_gateway_api_clients.erl @@ -423,7 +423,7 @@ schema("/gateway/:name/clients") -> schema("/gateway/:name/clients/:clientid") -> #{ 'operationId' => clients_insta , get => - #{ description => <<"Get the gateway client infomation">> + #{ description => <<"Get the gateway client information">> , parameters => params_client_insta() , responses => ?STANDARD_RESP(#{200 => schema_client()}) diff --git a/apps/emqx_gateway/src/emqx_gateway_cli.erl b/apps/emqx_gateway/src/emqx_gateway_cli.erl index 24bf559c1..0e51db6b9 100644 --- a/apps/emqx_gateway/src/emqx_gateway_cli.erl +++ b/apps/emqx_gateway/src/emqx_gateway_cli.erl @@ -111,7 +111,7 @@ gateway(_) -> [ {"gateway list", "List all gateway"} , {"gateway lookup ", - "Lookup a gateway detailed informations"} + "Lookup a gateway detailed information"} , {"gateway load ", "Load a gateway with config"} , {"gateway unload ", diff --git a/apps/emqx_gateway/src/emqx_gateway_cm.erl b/apps/emqx_gateway/src/emqx_gateway_cm.erl index d977b0933..536dc4b90 100644 --- a/apps/emqx_gateway/src/emqx_gateway_cm.erl +++ b/apps/emqx_gateway/src/emqx_gateway_cm.erl @@ -111,7 +111,7 @@ procname(GwName) -> ChannInfoTab :: atom()}. cmtabs(GwName) -> { tabname(chan, GwName) %% Record: {ClientId, Pid} - , tabname(conn, GwName) %% Recrod: {{ClientId, Pid}, ConnMod} + , tabname(conn, GwName) %% Record: {{ClientId, Pid}, ConnMod} , tabname(info, GwName) %% Record: {{ClientId, Pid}, Info, Stats} }. diff --git a/apps/emqx_gateway/src/emqx_gateway_cm_registry.erl b/apps/emqx_gateway/src/emqx_gateway_cm_registry.erl index 845ad7b7e..08f2ba455 100644 --- a/apps/emqx_gateway/src/emqx_gateway_cm_registry.erl +++ b/apps/emqx_gateway/src/emqx_gateway_cm_registry.erl @@ -45,7 +45,7 @@ -record(channel, {chid, pid}). -%% @doc Start the global channel registry for the gived gateway name. +%% @doc Start the global channel registry for the given gateway name. -spec(start_link(gateway_name()) -> gen_server:startlink_ret()). start_link(Name) -> gen_server:start_link(?MODULE, [Name], []). diff --git a/apps/emqx_gateway/src/emqx_gateway_insta_sup.erl b/apps/emqx_gateway/src/emqx_gateway_insta_sup.erl index ddeb3620d..2fe087af4 100644 --- a/apps/emqx_gateway/src/emqx_gateway_insta_sup.erl +++ b/apps/emqx_gateway/src/emqx_gateway_insta_sup.erl @@ -223,7 +223,7 @@ detailed_gateway_info(State) -> %% There are two layer authentication configs %% stomp.authn %% / \ -%% listeners.tcp.defautl.authn *.ssl.default.authn +%% listeners.tcp.default.authn *.ssl.default.authn %% init_authn(GwName, Config) -> diff --git a/apps/emqx_gateway/src/emqx_gateway_registry.erl b/apps/emqx_gateway/src/emqx_gateway_registry.erl index 706ad3816..6a2ec3be9 100644 --- a/apps/emqx_gateway/src/emqx_gateway_registry.erl +++ b/apps/emqx_gateway/src/emqx_gateway_registry.erl @@ -75,7 +75,7 @@ reg(Name, RgOpts) -> -spec unreg(gateway_name()) -> ok | {error, any()}. unreg(Name) -> - %% TODO: Checking ALL INSTACE HAS STOPPED + %% TODO: Checking ALL INSTANCE HAS STOPPED call({unreg, Name}). %% TODO: diff --git a/apps/emqx_gateway/src/emqx_gateway_schema.erl b/apps/emqx_gateway/src/emqx_gateway_schema.erl index a0549fda8..4de121587 100644 --- a/apps/emqx_gateway/src/emqx_gateway_schema.erl +++ b/apps/emqx_gateway/src/emqx_gateway_schema.erl @@ -186,7 +186,7 @@ received on an observed topic. The type of delivered coap message can be set to:
1. non: Non-confirmable;
2. con: Confirmable;
-3. qos: Mapping from QoS type of recevied message, QoS0 -> non, QoS1,2 -> con" +3. qos: Mapping from QoS type of received message, QoS0 -> non, QoS1,2 -> con" })} , {subscribe_qos, sc(hoconsc:union([qos0, qos1, qos2, coap]), @@ -222,7 +222,7 @@ fields(lwm2m) -> sc(binary(), #{ default =>"etc/lwm2m_xml" , nullable => false - , desc => "The Directory for LwM2M Resource defination" + , desc => "The Directory for LwM2M Resource definition" })} , {lifetime_min, sc(duration(), diff --git a/apps/emqx_gateway/src/exproto/README.md b/apps/emqx_gateway/src/exproto/README.md index a9375e5d3..a1eee4657 100644 --- a/apps/emqx_gateway/src/exproto/README.md +++ b/apps/emqx_gateway/src/exproto/README.md @@ -1,6 +1,6 @@ # emqx-exproto -The `emqx_exproto` extremly enhance the extensibility for EMQ X. It allow using an others programming language to **replace the protocol handling layer in EMQ X Broker**. +The `emqx_exproto` extremely enhance the extensibility for EMQ X. It allow using an others programming language to **replace the protocol handling layer in EMQ X Broker**. ## Feature diff --git a/apps/emqx_gateway/src/exproto/emqx_exproto_gsvr.erl b/apps/emqx_gateway/src/exproto/emqx_exproto_gsvr.erl index cb8a91868..50765e0ab 100644 --- a/apps/emqx_gateway/src/exproto/emqx_exproto_gsvr.erl +++ b/apps/emqx_gateway/src/exproto/emqx_exproto_gsvr.erl @@ -169,7 +169,7 @@ call(ConnStr, Req) -> , reason => {Class, Reason} , stacktrace => Stk }), - {error, ?RESP_UNKNOWN, <<"Unkwown crashs">>} + {error, ?RESP_UNKNOWN, <<"Unknown crashes">>} end. %%-------------------------------------------------------------------- diff --git a/apps/emqx_gateway/src/exproto/emqx_exproto_impl.erl b/apps/emqx_gateway/src/exproto/emqx_exproto_impl.erl index c42879cc1..ff52c2295 100644 --- a/apps/emqx_gateway/src/exproto/emqx_exproto_impl.erl +++ b/apps/emqx_gateway/src/exproto/emqx_exproto_impl.erl @@ -137,7 +137,7 @@ start_grpc_server(GwName, Options = #{bind := ListenOn}) -> console_print("Start ~ts gRPC server on ~p successfully.~n", [GwName, ListenOn]); {error, Reason} -> - ?ELOG("Falied to start ~ts gRPC server on ~p, reason: ~p", + ?ELOG("Failed to start ~ts gRPC server on ~p, reason: ~p", [GwName, ListenOn, Reason]) end. diff --git a/apps/emqx_gateway/src/exproto/protos/exproto.proto b/apps/emqx_gateway/src/exproto/protos/exproto.proto index 7d62c484e..d26acf55b 100644 --- a/apps/emqx_gateway/src/exproto/protos/exproto.proto +++ b/apps/emqx_gateway/src/exproto/protos/exproto.proto @@ -18,8 +18,8 @@ syntax = "proto3"; package emqx.exproto.v1; -// The Broker side serivce. It provides a set of APIs to -// handle a protcol access +// The Broker side service. It provides a set of APIs to +// handle a protocol access service ConnectionAdapter { // -- socket layer diff --git a/apps/emqx_gateway/src/lwm2m/emqx_lwm2m_channel.erl b/apps/emqx_gateway/src/lwm2m/emqx_lwm2m_channel.erl index c165b07c6..c53ca0528 100644 --- a/apps/emqx_gateway/src/lwm2m/emqx_lwm2m_channel.erl +++ b/apps/emqx_gateway/src/lwm2m/emqx_lwm2m_channel.erl @@ -51,12 +51,12 @@ clientinfo :: emqx_types:clientinfo(), %% Session session :: emqx_lwm2m_session:session() | undefined, - %% Channl State + %% Channel State %% TODO: is there need conn_state :: conn_state(), %% Timer timers :: #{atom() => disable | undefined | reference()}, - %% FIXME: don't store anonymouse func + %% FIXME: don't store anonymous func with_context :: function() }). @@ -215,7 +215,7 @@ handle_call({subscribe, Topic, SubOpts}, _From, _ = run_hooks(Ctx, 'session.subscribed', [ClientInfo, MountedTopic, NSubOpts]), - %% modifty session state + %% modify session state Subs = emqx_lwm2m_session:info(subscriptions, Session), NSubs = maps:put(MountedTopic, NSubOpts, Subs), NSession = emqx_lwm2m_session:set_subscriptions(NSubs, Session), @@ -231,7 +231,7 @@ handle_call({unsubscribe, Topic}, _From, ok = emqx_broker:unsubscribe(MountedTopic), _ = run_hooks(Ctx, 'session.unsubscribe', [ClientInfo, MountedTopic, #{}]), - %% modifty session state + %% modify session state Subs = emqx_lwm2m_session:info(subscriptions, Session), NSubs = maps:remove(MountedTopic, Subs), NSession = emqx_lwm2m_session:set_subscriptions(NSubs, Session), diff --git a/apps/emqx_gateway/src/lwm2m/emqx_lwm2m_tlv.erl b/apps/emqx_gateway/src/lwm2m/emqx_lwm2m_tlv.erl index e86e22e87..6dc716013 100644 --- a/apps/emqx_gateway/src/lwm2m/emqx_lwm2m_tlv.erl +++ b/apps/emqx_gateway/src/lwm2m/emqx_lwm2m_tlv.erl @@ -150,7 +150,7 @@ encode_value(Value) when is_integer(Value) -> encode_value(Value) when is_float(Value) -> <>; encode_value(Value) -> - error(io_lib:format("unsupport format ~p", [Value])). + error(io_lib:format("unsupported format ~p", [Value])). diff --git a/apps/emqx_gateway/src/mqttsn/README.md b/apps/emqx_gateway/src/mqttsn/README.md index 8179dde62..4d887d6e9 100644 --- a/apps/emqx_gateway/src/mqttsn/README.md +++ b/apps/emqx_gateway/src/mqttsn/README.md @@ -25,7 +25,7 @@ mqtt.sn.advertise_duration = 900 ## Value: Number mqtt.sn.gateway_id = 1 -## To control whether write statistics data into ETS table for dashbord to read. +## To control whether write statistics data into ETS table for dashboard to read. ## ## Value: on | off mqtt.sn.enable_stats = off @@ -61,7 +61,7 @@ mqtt.sn.password = abc - mqtt.sn.gateway_id * Gateway id in ADVERTISE message. - mqtt.sn.enable_stats - * To control whether write statistics data into ETS table for dashbord to read. + * To control whether write statistics data into ETS table for dashboard to read. - mqtt.sn.enable_qos3 * To control whether accept and process the received publish message with qos=-1. - mqtt.sn.predefined.topic.N diff --git a/apps/emqx_gateway/src/mqttsn/emqx_sn_channel.erl b/apps/emqx_gateway/src/mqttsn/emqx_sn_channel.erl index aee4189a5..5dc42cc88 100644 --- a/apps/emqx_gateway/src/mqttsn/emqx_sn_channel.erl +++ b/apps/emqx_gateway/src/mqttsn/emqx_sn_channel.erl @@ -261,7 +261,7 @@ maybe_assign_clientid(_Packet, ClientInfo) -> fix_mountpoint(_Packet, #{mountpoint := undefined}) -> ok; fix_mountpoint(_Packet, ClientInfo = #{mountpoint := Mountpoint}) -> - %% TODO: Enrich the varibale replacement???? + %% TODO: Enrich the variable replacement???? %% i.e: ${ClientInfo.auth_result.productKey} Mountpoint1 = emqx_mountpoint:replvar(Mountpoint, ClientInfo), {ok, ClientInfo#{mountpoint := Mountpoint1}}. @@ -357,7 +357,7 @@ handle_in(?SN_SEARCHGW_MSG(_Radius), {ok, {outgoing, ?SN_GWINFO_MSG(GwId, <<>>)}, Channel}; handle_in(?SN_ADVERTISE_MSG(_GwId, _Radius), Channel) -> - % ingore + % ignore shutdown(normal, Channel); handle_in(?SN_PUBLISH_MSG(#mqtt_sn_flags{qos = ?QOS_NEG1, diff --git a/apps/emqx_gateway/src/mqttsn/emqx_sn_impl.erl b/apps/emqx_gateway/src/mqttsn/emqx_sn_impl.erl index 4107c810d..3579bf4bd 100644 --- a/apps/emqx_gateway/src/mqttsn/emqx_sn_impl.erl +++ b/apps/emqx_gateway/src/mqttsn/emqx_sn_impl.erl @@ -89,7 +89,7 @@ on_gateway_load(_Gateway = #{ name := GwName, {ok, ListenerPids, _GwState = #{ctx => Ctx}}; {error, {Reason, Listener}} -> throw({badconf, #{ key => listeners - , vallue => Listener + , value => Listener , reason => Reason }}) end. diff --git a/apps/emqx_gateway/src/mqttsn/include/emqx_sn.hrl b/apps/emqx_gateway/src/mqttsn/include/emqx_sn.hrl index 00b0c40c8..36c481645 100644 --- a/apps/emqx_gateway/src/mqttsn/include/emqx_sn.hrl +++ b/apps/emqx_gateway/src/mqttsn/include/emqx_sn.hrl @@ -53,7 +53,7 @@ -define(SN_RC_CONGESTION, 16#01). -define(SN_RC_INVALID_TOPIC_ID, 16#02). -define(SN_RC_NOT_SUPPORTED, 16#03). -%% Custome Reason code by emqx +%% Custom Reason code by emqx -define(SN_RC_NOT_AUTHORIZE, 16#04). -define(SN_RC_FAILED_SESSION, 16#05). -define(SN_EXCEED_LIMITATION, 16#06). diff --git a/apps/emqx_gateway/src/stomp/emqx_stomp_channel.erl b/apps/emqx_gateway/src/stomp/emqx_stomp_channel.erl index 812007ed6..5d0daabb7 100644 --- a/apps/emqx_gateway/src/stomp/emqx_stomp_channel.erl +++ b/apps/emqx_gateway/src/stomp/emqx_stomp_channel.erl @@ -263,7 +263,7 @@ parse_heartbeat(#stomp_frame{headers = Headers}, ClientInfo) -> fix_mountpoint(_Packet, #{mountpoint := undefined}) -> ok; fix_mountpoint(_Packet, ClientInfo = #{mountpoint := Mountpoint}) -> - %% TODO: Enrich the varibale replacement???? + %% TODO: Enrich the variable replacement???? %% i.e: ${ClientInfo.auth_result.productKey} Mountpoint1 = emqx_mountpoint:replvar(Mountpoint, ClientInfo), {ok, ClientInfo#{mountpoint := Mountpoint1}}. @@ -492,7 +492,7 @@ handle_in(?PACKET(?CMD_COMMIT, Headers), Channel) -> maybe_outgoing_receipt(receipt_id(Headers), Outgoings, Chann1); {error, Reason, Chann1} -> %% FIXME: atomic for transaction ?? - ErrMsg = io_lib:format("Execute transaction ~ts falied: ~0p", + ErrMsg = io_lib:format("Execute transaction ~ts failed: ~0p", [TxId, Reason] ), handle_out(error, {receipt_id(Headers), ErrMsg}, Chann1) diff --git a/apps/emqx_gateway/test/emqx_gateway_cli_SUITE.erl b/apps/emqx_gateway/test/emqx_gateway_cli_SUITE.erl index fb59a67da..95d97a8c5 100644 --- a/apps/emqx_gateway/test/emqx_gateway_cli_SUITE.erl +++ b/apps/emqx_gateway/test/emqx_gateway_cli_SUITE.erl @@ -108,7 +108,7 @@ t_gateway_registry_list(_) -> t_gateway_usage(_) -> ?assertEqual( ["gateway list # List all gateway\n", - "gateway lookup # Lookup a gateway detailed informations\n", + "gateway lookup # Lookup a gateway detailed information\n", "gateway load # Load a gateway with config\n", "gateway unload # Unload the gateway\n", "gateway stop # Stop the gateway\n", @@ -181,13 +181,13 @@ t_gateway_start_stop(_) -> emqx_gateway_cli:gateway(["stop", "mqttsn"]), ?assertEqual("ok\n", acc_print()), - %% dupliacted stop gateway, return ok + %% duplicated stop gateway, return ok emqx_gateway_cli:gateway(["stop", "mqttsn"]), ?assertEqual("ok\n", acc_print()), emqx_gateway_cli:gateway(["start", "mqttsn"]), ?assertEqual("ok\n", acc_print()), - %% dupliacted start gateway, return ok + %% duplicated start gateway, return ok emqx_gateway_cli:gateway(["start", "mqttsn"]), ?assertEqual("ok\n", acc_print()), diff --git a/apps/emqx_gateway/test/emqx_gateway_cm_SUITE.erl b/apps/emqx_gateway/test/emqx_gateway_cm_SUITE.erl index b21021376..1f715774f 100644 --- a/apps/emqx_gateway/test/emqx_gateway_cm_SUITE.erl +++ b/apps/emqx_gateway/test/emqx_gateway_cm_SUITE.erl @@ -160,7 +160,7 @@ t_handle_process_down(Conf) -> _ = Pid ! {'DOWN', mref, process, self(), normal}, - timer:sleep(200), %% wait the asycn clear task + timer:sleep(200), %% wait the async clear task ?assertEqual( [], ets:tab2list(emqx_gateway_cm:tabname(chan, ?GWNAME))), diff --git a/apps/emqx_gateway/test/emqx_lwm2m_SUITE.erl b/apps/emqx_gateway/test/emqx_lwm2m_SUITE.erl index 13ac8c881..a26b447b3 100644 --- a/apps/emqx_gateway/test/emqx_lwm2m_SUITE.erl +++ b/apps/emqx_gateway/test/emqx_lwm2m_SUITE.erl @@ -1986,7 +1986,7 @@ verify_read_response_1(CmdId, UdpSock) -> Request = test_recv_coap_request(UdpSock), ?LOGT("LwM2M client got ~p", [Request]), - %% device replies the commond + %% device replies the command test_send_coap_response( UdpSock, "127.0.0.1", diff --git a/apps/emqx_gateway/test/emqx_sn_protocol_SUITE.erl b/apps/emqx_gateway/test/emqx_sn_protocol_SUITE.erl index 909afceab..aee5d5d1b 100644 --- a/apps/emqx_gateway/test/emqx_sn_protocol_SUITE.erl +++ b/apps/emqx_gateway/test/emqx_sn_protocol_SUITE.erl @@ -233,7 +233,7 @@ t_subscribe_case03(_) -> ?assertEqual(<<2, ?SN_DISCONNECT>>, receive_response(Socket)), gen_udp:close(Socket). -%% In this case We use predefined topic name to register and subcribe, +%% In this case We use predefined topic name to register and subscribe, %% and expect to receive the corresponding predefined topic id but not a new %% generated topic id from broker. We design this case to illustrate %% emqx_sn_gateway's compatibility of dealing with predefined and normal diff --git a/apps/emqx_gateway/test/emqx_stomp_SUITE.erl b/apps/emqx_gateway/test/emqx_stomp_SUITE.erl index 7c507d3fc..6aa22fb3b 100644 --- a/apps/emqx_gateway/test/emqx_stomp_SUITE.erl +++ b/apps/emqx_gateway/test/emqx_stomp_SUITE.erl @@ -451,7 +451,7 @@ t_rest_clienit_info(_) -> %% TODO: Mountpoint, AuthChain, Authorization + Mountpoint, ClientInfoOverride, %% Listeners, Metrics, Stats, ClientInfo %% -%% TODO: Start/Stop, List Instace +%% TODO: Start/Stop, List Instance %% %% TODO: RateLimit, OOM, diff --git a/apps/emqx_machine/src/emqx_global_gc.erl b/apps/emqx_machine/src/emqx_global_gc.erl index e9ab712af..af92fcaef 100644 --- a/apps/emqx_machine/src/emqx_global_gc.erl +++ b/apps/emqx_machine/src/emqx_global_gc.erl @@ -79,7 +79,7 @@ code_change(_OldVsn, State, _Extra) -> {ok, State}. %%-------------------------------------------------------------------- -%% Internel function +%% Internal function %%-------------------------------------------------------------------- ensure_timer(State) -> diff --git a/apps/emqx_modules/src/emqx_modules_conf.erl b/apps/emqx_modules/src/emqx_modules_conf.erl index cc5f1b908..5c9f51763 100644 --- a/apps/emqx_modules/src/emqx_modules_conf.erl +++ b/apps/emqx_modules/src/emqx_modules_conf.erl @@ -14,7 +14,7 @@ %% limitations under the License. %%-------------------------------------------------------------------- -%% @doc The emqx-modules configration interoperable interfaces +%% @doc The emqx-modules configuration interoperable interfaces -module(emqx_modules_conf). -behaviour(emqx_config_handler). diff --git a/apps/emqx_modules/src/emqx_topic_metrics_api.erl b/apps/emqx_modules/src/emqx_topic_metrics_api.erl index 9fe583ca3..dfef40a82 100644 --- a/apps/emqx_modules/src/emqx_topic_metrics_api.erl +++ b/apps/emqx_modules/src/emqx_topic_metrics_api.erl @@ -111,7 +111,7 @@ schema("/mqtt/topic_metrics/:topic") -> fields(reset) -> [ {topic , mk( binary() - , #{ desc => <<"Topic Name. If this paramter is not present, all created topic metrics will be reseted">> + , #{ desc => <<"Topic Name. If this parameter is not present, all created topic metrics will be reset">> , example => <<"testtopic/1">> , nullable => true})} , {action @@ -135,7 +135,7 @@ fields(topic_metrics) -> , example => <<"2022-01-14T21:48:47+08:00">>})}, { reset_time , mk( emqx_schema:rfc3339_system_time() - , #{ desc => <<"Topic Metrics reset date time, in rfc3339. Nullable if never reseted">> + , #{ desc => <<"Topic Metrics reset date time, in rfc3339. Nullable if never reset">> , nullable => true , example => <<"2022-01-14T21:48:47+08:00">>})}, { metrics diff --git a/apps/emqx_plugins/src/emqx_plugins.erl b/apps/emqx_plugins/src/emqx_plugins.erl index 9a81b1296..df95084f3 100644 --- a/apps/emqx_plugins/src/emqx_plugins.erl +++ b/apps/emqx_plugins/src/emqx_plugins.erl @@ -418,7 +418,7 @@ load_plugin_app(AppName, AppVsn, Ebin, RunningApps) -> {_, Vsn} -> case bin(Vsn) =:= bin(AppVsn) of true -> - %% already started on the exact versio + %% already started on the exact version ok; false -> %% running but a different version diff --git a/apps/emqx_plugins/src/emqx_plugins_cli.erl b/apps/emqx_plugins/src/emqx_plugins_cli.erl index f7d262a1e..6e9f1dca2 100644 --- a/apps/emqx_plugins/src/emqx_plugins_cli.erl +++ b/apps/emqx_plugins/src/emqx_plugins_cli.erl @@ -40,7 +40,7 @@ describe(NameVsn, LogFun) -> {ok, Plugin} -> LogFun("~ts~n", [to_json(Plugin)]); {error, Reason} -> - %% this should not happend unless the package is manually installed + %% this should not happen unless the package is manually installed %% corrupted packages installed from emqx_plugins:ensure_installed %% should not leave behind corrupted files ?SLOG(error, #{msg => "failed_to_describe_plugin", diff --git a/apps/emqx_plugins/test/emqx_plugins_SUITE.erl b/apps/emqx_plugins/test/emqx_plugins_SUITE.erl index 27f044dd7..f09c43e0d 100644 --- a/apps/emqx_plugins/test/emqx_plugins_SUITE.erl +++ b/apps/emqx_plugins/test/emqx_plugins_SUITE.erl @@ -118,7 +118,7 @@ t_demo_install_start_stop_uninstall(Config) -> ?assertEqual([], emqx_plugins:list()), ok. -%% help funtion to create a info file. +%% help function to create a info file. %% The file is in JSON format when built %% but since we are using hocon:load to load it %% ad-hoc test files can be in hocon format diff --git a/apps/emqx_plugins/test/emqx_plugins_tests.erl b/apps/emqx_plugins/test/emqx_plugins_tests.erl index b1b47fc51..b5c9f9da8 100644 --- a/apps/emqx_plugins/test/emqx_plugins_tests.erl +++ b/apps/emqx_plugins/test/emqx_plugins_tests.erl @@ -96,7 +96,7 @@ purge_test() -> ?assertEqual(ok, emqx_plugins:purge("a-1")), %% assert the dir is gone ?assertMatch({error, enoent}, file:read_file_info(Dir)), - %% wite a file for the dir path + %% write a file for the dir path ok = file:write_file(Dir, "a"), ?assertEqual(ok, emqx_plugins:purge("a-1")) end). diff --git a/apps/emqx_psk/src/emqx_psk.erl b/apps/emqx_psk/src/emqx_psk.erl index d90545a36..bd04c349d 100644 --- a/apps/emqx_psk/src/emqx_psk.erl +++ b/apps/emqx_psk/src/emqx_psk.erl @@ -120,7 +120,7 @@ handle_call({import, SrcFile}, _From, State) -> handle_call(Req, _From, State) -> ?SLOG(info, #{msg => "unexpected_call_discarded", req => Req}), - {reply, {error, unexecpted}, State}. + {reply, {error, unexpected}, State}. handle_cast(Req, State) -> ?SLOG(info, #{msg => "unexpected_cast_discarded", req => Req}), diff --git a/apps/emqx_resource/src/emqx_resource.erl b/apps/emqx_resource/src/emqx_resource.erl index 1f14e527d..3af25ad6f 100644 --- a/apps/emqx_resource/src/emqx_resource.erl +++ b/apps/emqx_resource/src/emqx_resource.erl @@ -60,7 +60,7 @@ -export([ restart/1 %% restart the instance. , restart/2 , health_check/1 %% verify if the resource is working normally - , set_resource_status_stoped/1 %% set resource status to stoped + , set_resource_status_stoped/1 %% set resource status to stopped , stop/1 %% stop the instance , query/2 %% query the instance , query/3 %% query the instance with after_query() diff --git a/apps/emqx_resource/src/emqx_resource_health_check.erl b/apps/emqx_resource/src/emqx_resource_health_check.erl index da5492a33..5791463ea 100644 --- a/apps/emqx_resource/src/emqx_resource_health_check.erl +++ b/apps/emqx_resource/src/emqx_resource_health_check.erl @@ -82,7 +82,7 @@ health_check_timeout_checker(Pid, Name, SleepTime, Timeout) -> health_check_finish -> timer:sleep(SleepTime) after Timeout -> emqx_alarm:activate(Name, #{name => Name}, - <>), + <>), emqx_resource:set_resource_status_stoped(Name), receive health_check_finish -> timer:sleep(SleepTime) diff --git a/apps/emqx_retainer/README.md b/apps/emqx_retainer/README.md index b3065fa9c..f5ae426a1 100644 --- a/apps/emqx_retainer/README.md +++ b/apps/emqx_retainer/README.md @@ -42,7 +42,7 @@ retainer.max_payload_size = 64KB ## - 30m: 30 minutes ## - 20s: 20 seconds ## -## Defaut: 0 +## Default: 0 retainer.expiry_interval = 0 ``` diff --git a/apps/emqx_retainer/src/emqx_retainer_api.erl b/apps/emqx_retainer/src/emqx_retainer_api.erl index afbc69f5c..fe4c5cf1f 100644 --- a/apps/emqx_retainer/src/emqx_retainer_api.erl +++ b/apps/emqx_retainer/src/emqx_retainer_api.erl @@ -92,7 +92,7 @@ with_topic_api() -> description => <<"delete matching messages">>, parameters => parameters(), responses => #{ - <<"204">> => schema(<<"Successed">>), + <<"204">> => schema(<<"Succeeded">>), <<"405">> => schema(<<"NotAllowed">>) } } diff --git a/apps/emqx_rule_engine/src/emqx_rule_api_schema.erl b/apps/emqx_rule_engine/src/emqx_rule_api_schema.erl index 7af10a342..2e928235a 100644 --- a/apps/emqx_rule_engine/src/emqx_rule_api_schema.erl +++ b/apps/emqx_rule_engine/src/emqx_rule_api_schema.erl @@ -100,7 +100,7 @@ fields("metrics") -> })} , {"outputs.total", sc(integer(), #{ desc => "How much times the outputs are called by the rule. " - "This value may serveral times of 'sql.matched', depending on the " + "This value may several times of 'sql.matched', depending on the " "number of the outputs of the rule." })} , {"outputs.success", sc(integer(), #{ diff --git a/apps/emqx_rule_engine/src/emqx_rule_engine_schema.erl b/apps/emqx_rule_engine/src/emqx_rule_engine_schema.erl index 0fe6bad79..ff9579b8b 100644 --- a/apps/emqx_rule_engine/src/emqx_rule_engine_schema.erl +++ b/apps/emqx_rule_engine/src/emqx_rule_engine_schema.erl @@ -87,7 +87,7 @@ fields("builtin_output_republish") -> The arguments of the built-in 'republish' output.
We can use variables in the args.
-The variables are selected by the rule. For exmaple, if the rule SQL is defined as following: +The variables are selected by the rule. For example, if the rule SQL is defined as following: SELECT clientid, qos, payload FROM \"t/1\" diff --git a/apps/emqx_rule_engine/src/emqx_rule_funcs.erl b/apps/emqx_rule_engine/src/emqx_rule_funcs.erl index 65a4c848b..c06ba1130 100644 --- a/apps/emqx_rule_engine/src/emqx_rule_funcs.erl +++ b/apps/emqx_rule_engine/src/emqx_rule_funcs.erl @@ -89,7 +89,7 @@ , subbits/6 ]). -%% Data Type Convertion +%% Data Type Conversion -export([ str/1 , str_utf8/1 , bool/1 @@ -150,7 +150,7 @@ , map_put/3 ]). -%% For backword compatibility +%% For backward compatibility -export([ mget/2 , mget/3 , mput/3 @@ -503,7 +503,7 @@ do_get_subbits(Bits, Sz, Len, <<"bits">>, <<"signed">>, <<"little">>) -> <>). %%------------------------------------------------------------------------------ -%% Data Type Convertion Funcs +%% Data Type Conversion Funcs %%------------------------------------------------------------------------------ str(Data) -> diff --git a/apps/emqx_rule_engine/test/emqx_rule_funcs_SUITE.erl b/apps/emqx_rule_engine/test/emqx_rule_funcs_SUITE.erl index 2381ce4ce..846191098 100644 --- a/apps/emqx_rule_engine/test/emqx_rule_funcs_SUITE.erl +++ b/apps/emqx_rule_engine/test/emqx_rule_funcs_SUITE.erl @@ -81,7 +81,7 @@ t_payload(_) -> ?assertEqual(c, apply_func(payload, [<<"a.b.c">>], Input#{payload => NestedMap})). %%------------------------------------------------------------------------------ -%% Data Type Convertion Funcs +%% Data Type Conversion Funcs %%------------------------------------------------------------------------------ t_str(_) -> ?assertEqual(<<"abc">>, emqx_rule_funcs:str("abc")), diff --git a/apps/emqx_slow_subs/src/emqx_slow_subs.erl b/apps/emqx_slow_subs/src/emqx_slow_subs.erl index 027b304b1..c8ef8a5d2 100644 --- a/apps/emqx_slow_subs/src/emqx_slow_subs.erl +++ b/apps/emqx_slow_subs/src/emqx_slow_subs.erl @@ -111,7 +111,7 @@ on_stats_update(#{clientid := ClientId, [_] -> %% if Latency > minimum value, we should update it %% if Latency < minimum value, maybe it can replace the minimum value - %% so alwyas update at here + %% so always update at here %% do we need check if Latency == minimum ??? ets:insert(?TOPK_TAB, #top_k{index = Index, type = Type, last_update_time = Ts}), diff --git a/bin/emqx b/bin/emqx index 8bd3640fa..2f9fe674e 100755 --- a/bin/emqx +++ b/bin/emqx @@ -258,7 +258,7 @@ check_user() { for ARG in "$@"; do CMD="${CMD} \"$ARG\"" done - # This will drop priviledges into the runner user + # This will drop privileges into the runner user # It exec's in a new shell and the current shell will exit exec su - "$RUNNER_USER" -c "$CMD" fi @@ -367,7 +367,7 @@ relx_start_command() { generate_config() { local name_type="$1" local node_name="$2" - ## Delete the *.siz files first or it cann't start after + ## Delete the *.siz files first or it can't start after ## changing the config 'log.rotation.size' rm -rf "${RUNNER_LOG_DIR}"/*.siz @@ -380,7 +380,7 @@ generate_config() { local NOW_TIME NOW_TIME="$(call_hocon now_time)" - ## ths command populates two files: app.