refactor: remove unused/old functions

This commit is contained in:
Chris 2022-02-09 10:14:13 +01:00
parent 94b0676ac6
commit c2772fdd09
6 changed files with 0 additions and 33 deletions

View File

@ -28,7 +28,6 @@
, on_stop/2
, on_query/4
, on_health_check/2
, on_jsonify/1
]).
-export([do_health_check/1]).
@ -43,9 +42,6 @@ roots() ->
%% this schema has no sub-structs
fields(_) -> [].
on_jsonify(Config) ->
Config.
%% ===================================================================
on_start(InstId, #{servers := Servers0,
port := Port,

View File

@ -31,7 +31,6 @@
, on_stop/2
, on_query/4
, on_health_check/2
, on_jsonify/1
]).
%% ecpool callback
@ -97,9 +96,6 @@ mongo_fields() ->
] ++
emqx_connector_schema_lib:ssl_fields().
on_jsonify(Config) ->
Config.
%% ===================================================================
on_start(InstId, Config = #{mongo_type := Type,

View File

@ -25,7 +25,6 @@
, on_stop/2
, on_query/4
, on_health_check/2
, on_jsonify/1
]).
-export([connect/1]).
@ -43,11 +42,6 @@ fields(config) ->
emqx_connector_schema_lib:relational_db_fields() ++
emqx_connector_schema_lib:ssl_fields().
%%=====================================================================
on_jsonify(#{server := Server}= Config) ->
Config#{server => emqx_connector_schema_lib:ip_port_to_string(Server)}.
%% ===================================================================
on_start(InstId, #{server := {Host, Port},
database := DB,

View File

@ -28,7 +28,6 @@
, on_stop/2
, on_query/4
, on_health_check/2
, on_jsonify/1
]).
-export([connect/1]).
@ -49,9 +48,6 @@ fields(config) ->
emqx_connector_schema_lib:relational_db_fields() ++
emqx_connector_schema_lib:ssl_fields().
on_jsonify(#{server := Server}= Config) ->
Config#{server => emqx_connector_schema_lib:ip_port_to_string(Server)}.
named_queries(type) -> map();
named_queries(nullable) -> true;
named_queries(_) -> undefined.

View File

@ -43,7 +43,6 @@
, on_stop/2
, on_query/4
, on_health_check/2
, on_jsonify/1
]).
-export([do_health_check/1]).
@ -85,9 +84,6 @@ fields(sentinel) ->
redis_fields() ++
emqx_connector_schema_lib:ssl_fields().
on_jsonify(Config) ->
Config.
%% ===================================================================
on_start(InstId, #{redis_type := Type,
database := Database,

View File

@ -70,7 +70,6 @@
-export([ call_start/3 %% start the instance
, call_health_check/3 %% verify if the resource is working normally
, call_stop/3 %% stop the instance
, call_jsonify/2
]).
-export([ list_instances/0 %% list all the instances, id only.
@ -86,11 +85,8 @@
-optional_callbacks([ on_query/4
, on_health_check/2
, on_jsonify/1
]).
-callback on_jsonify(resource_config()) -> jsx:json_term().
%% when calling emqx_resource:start/1
-callback on_start(instance_id(), resource_config()) ->
{ok, resource_state()} | {error, Reason :: term()}.
@ -284,13 +280,6 @@ call_health_check(InstId, Mod, ResourceState) ->
call_stop(InstId, Mod, ResourceState) ->
?SAFE_CALL(Mod:on_stop(InstId, ResourceState)).
-spec call_jsonify(module(), resource_config()) -> jsx:json_term().
call_jsonify(Mod, Config) ->
case erlang:function_exported(Mod, on_jsonify, 1) of
false -> Config;
true -> ?SAFE_CALL(Mod:on_jsonify(Config))
end.
-spec check_config(resource_type(), raw_resource_config()) ->
{ok, resource_config()} | {error, term()}.
check_config(ResourceType, Conf) ->