fix(bridge_syskeeper): add `resource_opts` to connector schema
This commit is contained in:
parent
5bdfac52b8
commit
3078de6e97
|
@ -93,7 +93,9 @@ roots() ->
|
||||||
[{config, #{type => hoconsc:ref(?MODULE, config)}}].
|
[{config, #{type => hoconsc:ref(?MODULE, config)}}].
|
||||||
|
|
||||||
fields(config) ->
|
fields(config) ->
|
||||||
emqx_connector_schema:common_fields() ++ fields("connection_fields");
|
emqx_connector_schema:common_fields() ++
|
||||||
|
fields("connection_fields") ++
|
||||||
|
emqx_connector_schema:resource_opts_ref(?MODULE, connector_resource_opts);
|
||||||
fields("connection_fields") ->
|
fields("connection_fields") ->
|
||||||
[
|
[
|
||||||
{server, server()},
|
{server, server()},
|
||||||
|
@ -114,6 +116,8 @@ fields("connection_fields") ->
|
||||||
emqx_connector_schema_lib:pool_size(Other)
|
emqx_connector_schema_lib:pool_size(Other)
|
||||||
end}
|
end}
|
||||||
];
|
];
|
||||||
|
fields(connector_resource_opts) ->
|
||||||
|
emqx_connector_schema:resource_opts_fields();
|
||||||
fields(Field) when
|
fields(Field) when
|
||||||
Field == "get";
|
Field == "get";
|
||||||
Field == "post";
|
Field == "post";
|
||||||
|
@ -125,6 +129,8 @@ fields(Field) when
|
||||||
|
|
||||||
desc(config) ->
|
desc(config) ->
|
||||||
?DESC("desc_config");
|
?DESC("desc_config");
|
||||||
|
desc(connector_resource_opts) ->
|
||||||
|
?DESC(emqx_resource_schema, "resource_opts");
|
||||||
desc(Method) when Method =:= "get"; Method =:= "put"; Method =:= "post" ->
|
desc(Method) when Method =:= "get"; Method =:= "put"; Method =:= "post" ->
|
||||||
["Configuration for Syskeeper Proxy using `", string:to_upper(Method), "` method."];
|
["Configuration for Syskeeper Proxy using `", string:to_upper(Method), "` method."];
|
||||||
desc(_) ->
|
desc(_) ->
|
||||||
|
|
|
@ -77,7 +77,9 @@ namespace() -> "connector_syskeeper_proxy".
|
||||||
roots() -> [].
|
roots() -> [].
|
||||||
|
|
||||||
fields(config) ->
|
fields(config) ->
|
||||||
emqx_connector_schema:common_fields() ++ fields("connection_fields");
|
emqx_connector_schema:common_fields() ++
|
||||||
|
fields("connection_fields") ++
|
||||||
|
emqx_connector_schema:resource_opts_ref(?MODULE, connector_resource_opts);
|
||||||
fields("connection_fields") ->
|
fields("connection_fields") ->
|
||||||
[
|
[
|
||||||
{listen, listen()},
|
{listen, listen()},
|
||||||
|
@ -92,6 +94,8 @@ fields("connection_fields") ->
|
||||||
#{desc => ?DESC(handshake_timeout), default => <<"10s">>}
|
#{desc => ?DESC(handshake_timeout), default => <<"10s">>}
|
||||||
)}
|
)}
|
||||||
];
|
];
|
||||||
|
fields(connector_resource_opts) ->
|
||||||
|
emqx_connector_schema:resource_opts_fields();
|
||||||
fields(Field) when
|
fields(Field) when
|
||||||
Field == "get";
|
Field == "get";
|
||||||
Field == "post";
|
Field == "post";
|
||||||
|
@ -103,6 +107,8 @@ fields(Field) when
|
||||||
|
|
||||||
desc(config) ->
|
desc(config) ->
|
||||||
?DESC("desc_config");
|
?DESC("desc_config");
|
||||||
|
desc(connector_resource_opts) ->
|
||||||
|
?DESC(emqx_resource_schema, "resource_opts");
|
||||||
desc(Method) when Method =:= "get"; Method =:= "put"; Method =:= "post" ->
|
desc(Method) when Method =:= "get"; Method =:= "put"; Method =:= "post" ->
|
||||||
["Configuration for Syskeeper Proxy using `", string:to_upper(Method), "` method."];
|
["Configuration for Syskeeper Proxy using `", string:to_upper(Method), "` method."];
|
||||||
desc(_) ->
|
desc(_) ->
|
||||||
|
|
Loading…
Reference in New Issue