summaryrefslogtreecommitdiff
path: root/src/ejabberd_sql.erl
diff options
context:
space:
mode:
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>2017-05-08 12:59:28 +0300
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>2017-05-08 12:59:28 +0300
commit01a2c9fe1202f88f20a5acbc729b627ce0ac3c0a (patch)
tree4aba0e94650d1311ab5b2da0e74563b1bd02a876 /src/ejabberd_sql.erl
parentLOG_PATH macro should be of string type (diff)
Add type specs for Module:opt_type/1
Diffstat (limited to 'src/ejabberd_sql.erl')
-rw-r--r--src/ejabberd_sql.erl14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/ejabberd_sql.erl b/src/ejabberd_sql.erl
index 4c85b874..dc6292ce 100644
--- a/src/ejabberd_sql.erl
+++ b/src/ejabberd_sql.erl
@@ -1080,6 +1080,20 @@ check_error({error, Why} = Err, Query) ->
check_error(Result, _Query) ->
Result.
+-spec opt_type(sql_database) -> fun((binary()) -> binary());
+ (sql_keepalive_interval) -> fun((pos_integer()) -> pos_integer());
+ (sql_password) -> fun((binary()) -> binary());
+ (sql_port) -> fun((0..65535) -> 0..65535);
+ (sql_server) -> fun((binary()) -> binary());
+ (sql_username) -> fun((binary()) -> binary());
+ (sql_ssl) -> fun((boolean()) -> boolean());
+ (sql_ssl_verify) -> fun((boolean()) -> boolean());
+ (sql_ssl_certfile) -> fun((boolean()) -> boolean());
+ (sql_ssl_cafile) -> fun((boolean()) -> boolean());
+ (sql_query_timeout) -> fun((pos_integer()) -> pos_integer());
+ (sql_connect_timeout) -> fun((pos_integer()) -> pos_integer());
+ (sql_queue_type) -> fun((ram | file) -> ram | file);
+ (atom()) -> [atom()].
opt_type(sql_database) -> fun iolist_to_binary/1;
opt_type(sql_keepalive_interval) ->
fun (I) when is_integer(I), I > 0 -> I end;