aboutsummaryrefslogtreecommitdiff
path: root/src/eldap_utils.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/eldap_utils.erl
parentLOG_PATH macro should be of string type (diff)
Add type specs for Module:opt_type/1
Diffstat (limited to 'src/eldap_utils.erl')
-rw-r--r--src/eldap_utils.erl23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/eldap_utils.erl b/src/eldap_utils.erl
index d15e5bc9c..52671061d 100644
--- a/src/eldap_utils.erl
+++ b/src/eldap_utils.erl
@@ -318,12 +318,25 @@ collect_parts_bit([{?N_BIT_STRING,<<Unused,Bits/binary>>}|Rest],Acc,Uacc) ->
collect_parts_bit([],Acc,Uacc) ->
list_to_binary([Uacc|lists:reverse(Acc)]).
+-type deref_aliases() :: never | searching | finding | always.
+-type uids() :: binary() | {binary()} | {binary(), binary()}.
+-spec opt_type(deref_aliases) -> fun((deref_aliases()) -> deref_aliases());
+ (ldap_backups) -> fun(([binary()]) -> [binary()]);
+ (ldap_base) -> fun((binary()) -> binary());
+ (ldap_deref_aliases) -> fun((deref_aliases()) -> deref_aliases());
+ (ldap_encrypt) -> fun((tls | starttls | none) -> tls | starttls | none);
+ (ldap_password) -> fun((binary()) -> binary());
+ (ldap_port) -> fun((0..65535) -> 0..65535);
+ (ldap_rootdn) -> fun((binary()) -> binary());
+ (ldap_servers) -> fun(([binary()]) -> [binary()]);
+ (ldap_tls_certfile) -> fun((binary()) -> string());
+ (ldap_tls_depth) -> fun((non_neg_integer()) -> non_neg_integer());
+ (ldap_tls_verify) -> fun((hard | soft | false) -> hard | soft | false);
+ (ldap_filter) -> fun((binary()) -> binary());
+ (ldap_uids) -> fun((uids()) -> uids());
+ (atom()) -> [atom()].
opt_type(deref_aliases) ->
- fun (never) -> never;
- (searching) -> searching;
- (finding) -> finding;
- (always) -> always
- end;
+ opt_type(ldap_deref_aliases);
opt_type(ldap_backups) ->
fun (L) -> [iolist_to_binary(H) || H <- L] end;
opt_type(ldap_base) -> fun iolist_to_binary/1;