Module valeo

Erlang External Programs Supervisor.

Copyright © 2010-2013 ALEPH ARCHIVES Ltd. All rights reserved.

Version: 1.2.2

Authors: Aleph Archives Ltd. [web site: http://aleph-archives.com/].

Description

Erlang External Programs Supervisor.

Framework to extend Erlang supervision to external programs.

Data Types

cmd_params()

cmd_params() = [cmd_val() | {string(), cmd_val()}]

cmd_val()

cmd_val() = string() | binary() | integer()

port_cmd_opts()

port_cmd_opts() = [force | nosuspend]

port_mode()

port_mode() = active | passive

port_ret()

port_ret() = timeout | {data, iodata()} | {exit_status, integer()} | {'EXIT', term()}

proplist()

proplist() = [{atom(), term()}]

Function Index

command/2Syntactic sugar for port_command/2 call.
command/3Syntactic sugar for port_command/3 call.
exec_find/1Equivalent to exec_find(ProgName, ?MODULE).
exec_find/2Returns the executable pathname by:
  • first, checking the "priv" directory associated with module Mod
  • second, using the %PATH% environment variable
.
exec_line/2Returns a formatted command line.
proc_id/1Returns the OS process ID for the program under control.
revision/0Returns the current VALEO revision number.
start_link/3Start a named VALEO server and link it the calling process.
state/1Returns the internal state of the program under control.
stop/1Stop the Valeo port program.
version/0Returns the current VALEO version number.

Function Details

command/2

command(Pid::pid() | atom, IoData::iodata()) -> ok

Syntactic sugar for port_command/2 call.

command/3

command(Pid::pid() | atom, IoData::iodata(), Opts::port_cmd_opts()) -> ok

Syntactic sugar for port_command/3 call.

exec_find/1

exec_find(ProgName::string()) -> string() | false

Equivalent to exec_find(ProgName, ?MODULE).

exec_find/2

exec_find(ProgName::string(), Mod::atom()) -> string() | false

Returns the executable pathname by:

Returns the full pathname, or 'false' otherwise.

Eg.: valeo:exec_find("ssh").

exec_line/2

exec_line(Cmd::string(), CmdParams::cmd_params()) -> string() | false

Returns a formatted command line. Eg.: valeo:exec_line("ssh", [{"-p", 22}, "foo@10.11.81.3"]).

proc_id/1

proc_id(Pid::pid() | atom) -> non_neg_integer() | undefined

Returns the OS process ID for the program under control.

revision/0

revision() -> string()

Returns the current VALEO revision number.

start_link/3

start_link(Module::atom(), ProgArgs::proplist(), PortArgs::proplist()) -> {ok, pid()}

Start a named VALEO server and link it the calling process.

state/1

state(Pid::pid() | atom) -> term() | undefined

Returns the internal state of the program under control.

stop/1

stop(Pid::pid() | atom) -> ok

Stop the Valeo port program.

version/0

version() -> string()

Returns the current VALEO version number.


Generated by EDoc, May 6 2013, 23:03:07.