From e9f93c38cd87e929167d70a870cdba3b9c8104e2 Mon Sep 17 00:00:00 2001 From: Mikhail Uvarov Date: Fri, 5 Nov 2021 10:50:32 +0100 Subject: [PATCH] Move host_type_or_global() type into mongooseim module --- src/mongoose_backend.erl | 2 +- src/mongooseim.erl | 3 ++- src/wpool/mongoose_wpool.erl | 3 +-- src/wpool/mongoose_wpool_http.erl | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mongoose_backend.erl b/src/mongoose_backend.erl index 68798256ed1..a407d5e1146 100644 --- a/src/mongoose_backend.erl +++ b/src/mongoose_backend.erl @@ -20,7 +20,7 @@ -type function_name() :: atom(). -type main_module() :: module(). -type backend_module() :: module(). --type host_type_or_global() :: host_type_or_global() | global. +-type host_type_or_global() :: mongooseim:host_type_or_global(). -spec init(HostType :: host_type_or_global(), MainModule :: main_module(), diff --git a/src/mongooseim.erl b/src/mongooseim.erl index bc10ce0c35d..47e39a4484c 100644 --- a/src/mongooseim.erl +++ b/src/mongooseim.erl @@ -16,8 +16,9 @@ -module(mongooseim). -type host_type() :: binary(). +-type host_type_or_global() :: host_type() | global. -type domain_name() :: jid:lserver(). --export_type([host_type/0, domain_name/0]). +-export_type([host_type/0, host_type_or_global/0, domain_name/0]). %% API -export([start/0]). diff --git a/src/wpool/mongoose_wpool.erl b/src/wpool/mongoose_wpool.erl index 4555b570a17..7717fb023e9 100644 --- a/src/wpool/mongoose_wpool.erl +++ b/src/wpool/mongoose_wpool.erl @@ -48,7 +48,7 @@ %% Config scope -type scope() :: global | host | mongooseim:host_type(). --type host_type_or_global() :: mongooseim:host_type() | global. +-type host_type_or_global() :: mongooseim:host_type_or_global(). -type tag() :: atom(). %% Name of a process @@ -86,7 +86,6 @@ -export_type([proc_name/0]). -export_type([pool_opts/0]). -export_type([conn_opts/0]). --export_type([host_type_or_global/0]). -type callback_fun() :: init | start | default_opts | is_supported_strategy | stop. diff --git a/src/wpool/mongoose_wpool_http.erl b/src/wpool/mongoose_wpool_http.erl index 94bca9dc69f..ddb404d3add 100644 --- a/src/wpool/mongoose_wpool_http.erl +++ b/src/wpool/mongoose_wpool_http.erl @@ -51,7 +51,7 @@ stop(HostType, Tag) -> %% -------------------------------------------------------------- %% Other API functions --spec get_params(HostType :: mongoose_wpool:host_type_or_global(), +-spec get_params(HostType :: mongooseim:host_type_or_global(), Tag :: mongoose_wpool:tag()) -> {ok, PathPrefix :: path_prefix(), RequestTimeout :: request_timeout()} | {error, pool_not_started}.