From 47f826f99a5d645ac51e8c8e22803938206797a4 Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Thu, 8 Jun 2023 18:32:33 +0200 Subject: [PATCH] chore: fix typo --- apps/emqx/src/emqx_schema.erl | 4 ++-- .../test/emqx_authz_redis_SUITE.erl | 2 +- .../src/emqx_bridge_influxdb.erl | 18 +++++++------- apps/emqx_conf/src/emqx_conf_schema.erl | 2 +- .../src/emqx_ee_bridge_redis.erl | 24 +++++++++---------- rel/emqx_conf.template.en.md | 4 ++-- 6 files changed, 27 insertions(+), 27 deletions(-) diff --git a/apps/emqx/src/emqx_schema.erl b/apps/emqx/src/emqx_schema.erl index dd04fad78..8c520d14f 100644 --- a/apps/emqx/src/emqx_schema.erl +++ b/apps/emqx/src/emqx_schema.erl @@ -3018,7 +3018,7 @@ non_empty_string(_) -> {error, invalid_string}. %% hosts can be successfully parsed. %% 3. parsing: Done at runtime in each module which uses this config servers_sc(Meta0, ParseOpts) -> - %% if this filed has a default value + %% if this field has a default value %% then it is not NOT required %% NOTE: maps:is_key is not the solution because #{default => undefined} is legit HasDefault = (maps:get(default, Meta0, undefined) =/= undefined), @@ -3079,7 +3079,7 @@ servers_validator(Opts, Required) -> %% we should remove field from config if it's empty throw("cannot_be_empty"); "undefined" when Required -> - %% when the filed is not set in config file + %% when the field is not set in config file %% NOTE: assuming nobody is going to name their server "undefined" throw("cannot_be_empty"); "undefined" -> diff --git a/apps/emqx_authz/test/emqx_authz_redis_SUITE.erl b/apps/emqx_authz/test/emqx_authz_redis_SUITE.erl index d68ea342e..35aa0449f 100644 --- a/apps/emqx_authz/test/emqx_authz_redis_SUITE.erl +++ b/apps/emqx_authz/test/emqx_authz_redis_SUITE.erl @@ -181,7 +181,7 @@ t_create_with_config_values_wont_work(_Config) -> InvalidConfigs ). -%% creating without a require filed should return error +%% creating without a require field should return error t_create_invalid_config(_Config) -> AuthzConfig = raw_redis_authz_config(), C = maps:without([<<"server">>], AuthzConfig), diff --git a/apps/emqx_bridge_influxdb/src/emqx_bridge_influxdb.erl b/apps/emqx_bridge_influxdb/src/emqx_bridge_influxdb.erl index c2a04e93d..dd340d15e 100644 --- a/apps/emqx_bridge_influxdb/src/emqx_bridge_influxdb.erl +++ b/apps/emqx_bridge_influxdb/src/emqx_bridge_influxdb.erl @@ -95,33 +95,33 @@ namespace() -> "bridge_influxdb". roots() -> []. fields("post_api_v1") -> - method_fileds(post, influxdb_api_v1); + method_fields(post, influxdb_api_v1); fields("post_api_v2") -> - method_fileds(post, influxdb_api_v2); + method_fields(post, influxdb_api_v2); fields("put_api_v1") -> - method_fileds(put, influxdb_api_v1); + method_fields(put, influxdb_api_v1); fields("put_api_v2") -> - method_fileds(put, influxdb_api_v2); + method_fields(put, influxdb_api_v2); fields("get_api_v1") -> - method_fileds(get, influxdb_api_v1); + method_fields(get, influxdb_api_v1); fields("get_api_v2") -> - method_fileds(get, influxdb_api_v2); + method_fieds(get, influxdb_api_v2); fields(Type) when Type == influxdb_api_v1 orelse Type == influxdb_api_v2 -> influxdb_bridge_common_fields() ++ connector_fields(Type). -method_fileds(post, ConnectorType) -> +method_fields(post, ConnectorType) -> influxdb_bridge_common_fields() ++ connector_fields(ConnectorType) ++ type_name_fields(ConnectorType); -method_fileds(get, ConnectorType) -> +method_fields(get, ConnectorType) -> influxdb_bridge_common_fields() ++ connector_fields(ConnectorType) ++ type_name_fields(ConnectorType) ++ emqx_bridge_schema:status_fields(); -method_fileds(put, ConnectorType) -> +method_fields(put, ConnectorType) -> influxdb_bridge_common_fields() ++ connector_fields(ConnectorType). diff --git a/apps/emqx_conf/src/emqx_conf_schema.erl b/apps/emqx_conf/src/emqx_conf_schema.erl index bf500de26..9725c2da9 100644 --- a/apps/emqx_conf/src/emqx_conf_schema.erl +++ b/apps/emqx_conf/src/emqx_conf_schema.erl @@ -1323,7 +1323,7 @@ roots(Module) -> lists:map(fun({_BinName, Root}) -> Root end, hocon_schema:roots(Module)). %% Like authentication schema, authorization schema is incomplete in emqx_schema -%% module, this function replaces the root filed "authorization" with a new schema +%% module, this function replaces the root field "authorization" with a new schema emqx_schema_high_prio_roots() -> Roots = emqx_schema:roots(high), Authz = diff --git a/lib-ee/emqx_ee_bridge/src/emqx_ee_bridge_redis.erl b/lib-ee/emqx_ee_bridge/src/emqx_ee_bridge_redis.erl index a728ecb7e..ff15aa00f 100644 --- a/lib-ee/emqx_ee_bridge/src/emqx_ee_bridge_redis.erl +++ b/lib-ee/emqx_ee_bridge/src/emqx_ee_bridge_redis.erl @@ -101,23 +101,23 @@ namespace() -> "bridge_redis". roots() -> []. fields("post_single") -> - method_fileds(post, redis_single); + method_fields(post, redis_single); fields("post_sentinel") -> - method_fileds(post, redis_sentinel); + method_fields(post, redis_sentinel); fields("post_cluster") -> - method_fileds(post, redis_cluster); + method_fields(post, redis_cluster); fields("put_single") -> - method_fileds(put, redis_single); + method_fields(put, redis_single); fields("put_sentinel") -> - method_fileds(put, redis_sentinel); + method_fields(put, redis_sentinel); fields("put_cluster") -> - method_fileds(put, redis_cluster); + method_fields(put, redis_cluster); fields("get_single") -> - method_fileds(get, redis_single); + method_fields(get, redis_single); fields("get_sentinel") -> - method_fileds(get, redis_sentinel); + method_fields(get, redis_sentinel); fields("get_cluster") -> - method_fileds(get, redis_cluster); + method_fields(get, redis_cluster); fields(Type) when Type == redis_single orelse Type == redis_sentinel orelse Type == redis_cluster -> @@ -126,16 +126,16 @@ fields(Type) when fields("creation_opts_" ++ Type) -> resource_creation_fields(Type). -method_fileds(post, ConnectorType) -> +method_fields(post, ConnectorType) -> redis_bridge_common_fields(ConnectorType) ++ connector_fields(ConnectorType) ++ type_name_fields(ConnectorType); -method_fileds(get, ConnectorType) -> +method_fields(get, ConnectorType) -> redis_bridge_common_fields(ConnectorType) ++ connector_fields(ConnectorType) ++ type_name_fields(ConnectorType) ++ emqx_bridge_schema:status_fields(); -method_fileds(put, ConnectorType) -> +method_fields(put, ConnectorType) -> redis_bridge_common_fields(ConnectorType) ++ connector_fields(ConnectorType). diff --git a/rel/emqx_conf.template.en.md b/rel/emqx_conf.template.en.md index c1259869c..2dcb83896 100644 --- a/rel/emqx_conf.template.en.md +++ b/rel/emqx_conf.template.en.md @@ -84,7 +84,7 @@ There are 4 complex data types in EMQX's HOCON config: 1. Array: `[ElementType]` ::: tip Tip -If map filed name is a positive integer number, it is interpreted as an alternative representation of an `Array`. +If map field name is a positive integer number, it is interpreted as an alternative representation of an `Array`. For example: ``` myarray.1 = 74 @@ -120,7 +120,7 @@ If we consider the whole EMQX config as a tree, to reference a primitive value, we can use a dot-separated names form string for the path from the tree-root (always a Struct) down to the primitive values at tree-leaves. -Each segment of the dotted string is a Struct filed name or Map key. +Each segment of the dotted string is a Struct field name or Map key. For Array elements, 1-based index is used. below are some examples