- 论坛徽章:
- 30
|
本帖最后由 shijiang1130 于 2014-11-26 13:29 编辑
在哪个开源的地方或者内部的OTP/APP里使用到了:
从ssh的lib来看,proplists:get_value使用率还是很高的。
怎么用的:- ---------- SSH.ERL
- [62]-spec connect(string(), integer(), proplists:proplist()) -> {ok, pid()} | {error, term()}.
- [63]-spec connect(string(), integer(), proplists:proplist(), timeout()) -> {ok, pid()} | {error, term()}.
- [75] proplists:get_value(transport, Options, {tcp, gen_tcp, tcp_closed}),
- [76] ConnectionTimeout = proplists:get_value(connect_timeout, Options, infinity),
- [117]-spec daemon(integer(), proplists:proplist()) -> {ok, pid()}.
- [118]-spec daemon(any | inet:ip_address(), integer(), proplists:proplist()) -> {ok, pid()}.
- [130] Options1 = case proplists:get_value(shell, Options0) of
- [140] {Host0, proplists:get_value(inet, Options1, inet), Options1};
- [176]-spec shell(string(), proplists:proplist()) -> _.
- [177]-spec shell(string(), integer(), proplists:proplist()) -> _.
- [213] case proplists:get_value(idle_time, SshOptions) of
- [257] try handle_option(proplists:unfold(Opts), [], []) of
- ---------- SSHC_SUP.ERL
- ---------- SSHD_SUP.ERL
- [42] Address = proplists:get_value(address, ServerOpts),
- [43] Port = proplists:get_value(port, ServerOpts),
- [79] Address = proplists:get_value(address, ServerOpts),
- [80] Port = proplists:get_value(port, ServerOpts),
- ---------- SSH_ACCEPTOR.ERL
- [44] proplists:get_value(transport, Opts, {tcp, gen_tcp, tcp_closed}),
- [85] SSHopts = proplists:get_value(ssh_opts, Options, []),
- [86] MaxSessions = proplists:get_value(max_sessions,SSHopts,infinity),
- [91] Timeout = proplists:get_value(negotiation_timeout, SSHopts, 2*60*1000),
- ---------- SSH_ACCEPTOR_SUP.ERL
- [46] Address = proplists:get_value(address, ServerOpts),
- [47] Port = proplists:get_value(port, ServerOpts),
- [78] Address = proplists:get_value(address, ServerOpts),
- [79] Port = proplists:get_value(port, ServerOpts),
- [80] Timeout = proplists:get_value(timeout, ServerOpts, ?DEFAULT_TIMEOUT),
- [82] SocketOpts = proplists:get_value(socket_opts, ServerOpts),
- ---------- SSH_APP.ERL
- ---------- SSH_AUTH.ERL
- [45] KeyCb = proplists:get_value(key_cb, Opts, ssh_file),
- [70] Password = case proplists:get_value(password, Opts) of
- [118] case proplists:get_value(pref_public_key_algs, Opts, false) of
- [120] FirstAlg = proplists:get_value(public_key_alg, Opts, ?PREFERRED_PK_ALG),
- [122] AllowUserInt = proplists:get_value(user_interaction, Opts, true),
- [133] AllowUserInt = proplists:get_value(user_interaction, Opts, true),
- [140] AllowUserInt = proplists:get_value(user_interaction, Opts, true),
- [307] case proplists:get_value(user, Opts, os:getenv(Env)) of
- [320] case proplists:get_value(pwdfun, Opts) of
- [329] Passwords = proplists:get_value(user_passwords, Opts, []),
- [332] false -> proplists:get_value(password, Opts, false)
- [337] KeyCb = proplists:get_value(key_cb, Opts, ssh_file),
- [372] case proplists:get_value(keyboard_interact_fun, Opts) of
- [376] case proplists:get_value(password, Opts) of
- ---------- SSH_BITS.ERL
- ---------- SSH_CHANNEL.ERL
- [151] Cb = proplists:get_value(channel_cb, Options),
- [152] ConnectionManager = proplists:get_value(cm, Options),
- [153] ChannelId = proplists:get_value(channel_id, Options),
- [156] case proplists:get_value(exec, Options) of
- [158] proplists:get_value(init_args, Options);
- [160] proplists:get_value(init_args, Options) ++ [Exec]
- ---------- SSH_CHANNEL_SUP.ERL
- ---------- SSH_CLI.ERL
- [465] proplists:get_value(user, ConnectionInfo),
- [471] proplists:get_value(peer, ConnectionInfo),
- [491] proplists:get_value(user, ConnectionInfo),
- [500] proplists:get_value(peer, ConnectionInfo),
- [514] case proplists:get_value(echo, Modes, 1) of
- ---------- SSH_CLIENT_KEY_API.ERL
- [26] Algorithm :: 'ssh-rsa'| 'ssh-dss'| atom(), ConnectOptions :: proplists:proplist()) ->
- [29]-callback user_key(Algorithm :: 'ssh-rsa'| 'ssh-dss'| atom(), ConnectOptions :: proplists:proplist()) ->
- ---------- SSH_CONNECTION.ERL
- [935] case proplists:get_value(subsystems, Options, no_subsys) of
- [940] proplists:get_value(SsName, SubSystems, {none, []})
- [944] Subsystems = proplists:get_value(subsystems, Options, []),
- [945] case proplists:get_value(SsName, Subsystems, {none, []}) of
- ---------- SSH_CONNECTION_HANDLER.ERL
- [87]-spec start_connection(client| server, port(), proplists:proplist(),
- [94] proplists:get_value(transport, Options, {tcp, gen_tcp, tcp_closed}),
- [107] case proplists:get_value(parallel_login, Options, false) of
- [122] Sups = proplists:get_value(supervisors, Options),
- [123] ConnectionSup = proplists:get_value(connection_sup, Sups),
- [124] Opts = [{supervisors, Sups}, {user_pid, self()} | proplists:get_value(ssh_opts, Options, [])],
- [126] {_, Callback, _} = proplists:get_value(transport, Options, {tcp, gen_tcp, tcp_closed}),
- [139] proplists:get_value(transport, SshOpts, {tcp, gen_tcp, tcp_closed}),
- [232]-spec connection_info(pid(), [atom()]) -> proplists:proplist().
- [238]-spec channel_info(pid(), channel_id(), [atom()]) -> proplists:proplist().
- [595] MaxSent = proplists:get_value(rekey_limit, State#state.opts, 1024000000),
- [791] SSHOpts = proplists:get_value(ssh_opts, Opts),
- [905] proplists:get_value(address, SshParams#ssh.opts)])),
- [965] Pid = proplists:get_value(user_pid, Opts),
- [973] Sups = proplists:get_value(supervisors, Opts),
- [974] Pid = proplists:get_value(user_pid, Opts),
- [975] SystemSup = proplists:get_value(system_sup, Sups),
- [976] SubSystemSup = proplists:get_value(subsystem_sup, Sups),
- [977] ConnectionSup = proplists:get_value(connection_sup, Sups),
- [978] Shell = proplists:get_value(shell, Opts),
- [979] Exec = proplists:get_value(exec, Opts),
- [980] CliSpec = proplists:get_value(ssh_cli, Opts, {ssh_cli, [Shell]}),
- [990] case proplists:get_value(idle_time, SshOptions) of
- [998] IOCb = case proplists:get_value(user_interaction, Options, true) of
- [1005] AuthMethods = proplists:get_value(auth_methods, Options,
- [1009] PeerName = proplists:get_value(host, Options),
- [1010] KeyCb = proplists:get_value(key_cb, Options, ssh_file),
- [1017] userauth_quiet_mode = proplists:get_value(quiet_mode, Options, false),
- [1026] AuthMethods = proplists:get_value(auth_methods, Options,
- [1029] KeyCb = proplists:get_value(key_cb, Options, ssh_file),
- [1035] io_cb = proplists:get_value(io_cb, Options, ssh_io),
- [1044] case extract_algs(proplists:get_value(pref_public_key_algs, Options, false), []) of
- [1192] SSHOpts = proplists:get_value(ssh_opts, Opts),
- [1203] SSHOpts = proplists:get_value(ssh_opts, Opts),
- [1277] case proplists:get_value(idle_time, Opts, infinity) of
- [1416] case proplists:get_value(connectfun, Opts) of
- [1427] case proplists:get_value(failfun, Opts) of
- [1435] case proplists:get_value(infofun, Opts) of
- [1515] case proplists:get_value(disconnectfun, Opts) of
- [1524] case proplists:get_value(size, ets:info(Cache)) of
- [1526] case proplists:get_value(idle_time, Opts, infinity) of
- ---------- SSH_CONNECTION_SUP.ERL
- ---------- SSH_DAEMON_CHANNEL.ERL
- ---------- SSH_FILE.ERL
- [53] Password = proplists:get_value(identity_pass_phrase(Algorithm), Opts, ignore),
- [77] Password = proplists:get_value(identity_pass_phrase(Algorithm), Opts, ignore),
- [160] case proplists:get_value(user_dir_fun, Opts) of
- [162] case proplists:get_value(user_dir, Opts) of
- [174] case proplists:get_value(user_dir, Opts, false) of
- [181] proplists:get_value(system_dir, Opts, "/etc/ssh").
- [238] handle_host(Fd, KeyToMatch, Host, proplists:get_value(hostnames, Attributes), Key, KeyType);
- ---------- SSH_IO.ERL
- [31] proplists:get_value(user_pid, Ssh) ! {self(), question},
- [39] proplists:get_value(user_pid, Ssh#ssh.opts) ! {self(), question},
- [60] proplists:get_value(user_pid, Ssh#ssh.opts) ! {self(), user_password};
- [62] proplists:get_value(user_pid, Ssh) ! {self(), user_password}
- ---------- SSH_MATH.ERL
- ---------- SSH_MESSAGE.ERL
- ---------- SSH_NO_IO.ERL
- ---------- SSH_SERVER_KEY_API.ERL
- [25]-callback host_key(Algorithm :: 'ssh-rsa'| 'ssh-dss'| atom(), DaemonOptions :: proplists:proplist()) ->
- [29] User :: string(), DaemonOptions :: proplists:proplist()) ->
- ---------- SSH_SFTP.ERL
- [87] Timeout = proplists:get_value(timeout, Opts, infinity),
- [111] Timeout = proplists:get_value(timeout, Opts, infinity),
- [112] case ssh_xfer:connect(Host, Port, proplists:delete(timeout, Opts)) of
- ---------- SSH_SFTPD.ERL
- [93] {FileMod, FS0} = case proplists:get_value(file_handler, Options,
- [102] CWD = proplists:get_value(cwd, Options, Default),
- [104] Root0 = proplists:get_value(root, Options, ""),
- [120] MaxLength = proplists:get_value(max_files, Options, 0),
- [121] Vsn = proplists:get_value(sftpd_vsn, Options, 5),
- ---------- SSH_SFTPD_FILE.ERL
- ---------- SSH_SFTPD_FILE_API.ERL
- ---------- SSH_SHELL.ERL
- ---------- SSH_SUBSYSTEM_SUP.ERL
- [64] case proplists:get_value(role, Opts) of
- [72] Address = proplists:get_value(address, Opts),
- [73] Port = proplists:get_value(port, Opts),
- [74] Role = proplists:get_value(role, Opts),
- [84] Address = proplists:get_value(address, Opts),
- [85] Port = proplists:get_value(port, Opts),
- [86] Role = proplists:get_value(role, Opts),
- ---------- SSH_SUP.ERL
- ---------- SSH_SYSTEM_SUP.ERL
- [46] Address = proplists:get_value(address, ServerOpts),
- [47] Port = proplists:get_value(port, ServerOpts),
- [138] Address = proplists:get_value(address, ServerOpts),
- [139] Port = proplists:get_value(port, ServerOpts),
- ---------- SSH_TRANSPORT.ERL
- [46] Vsn = proplists:get_value(vsn, Options, ?DEFAULT_CLIENT_VERSION),
- [50] Vsn = proplists:get_value(vsn, Options, ?DEFAULT_SERVER_VERSION),
- [104] Compression = case proplists:get_value(compression, Opts, none) of
- [121] lists:member(CryptoAlgo, proplists:get_value(ciphers, Supports, []))],
- [125] lists:member(CryptoAlgo, proplists:get_value(hashs, Supports, []))],
- [346] case proplists:get_value(silently_accept_hosts, Opts, false) of
- ---------- SSH_XFER.ERL
- [62] TMO = proplists:get_value(timeout, Opts, infinity),
复制代码 |
|