module Server: sig
.. end
Where the server commands are registered, and the server interfaces are
created and controlled.
Configuration parameters
val conf : Dtools.Conf.ut
The configuration of the server.
val conf_socket : bool Dtools.Conf.t
Should a socket server be created?
val conf_socket_path : string Dtools.Conf.t
Path of the socket.
val conf_socket_perms : int Dtools.Conf.t
Permissions of the socket. *
val conf_telnet : bool Dtools.Conf.t
Should a telnet server be created?
val conf_telnet_bind_addr : string Dtools.Conf.t
Address of the telnet server.
val conf_telnet_port : int Dtools.Conf.t
Port of the telnet server.
Commands of the server
type
namespace = string list
Namespaces are used to avoid name conflicts. Any entity which wants to add
commands to the server should first get a new unique namespace, in which the
commands will be added.
val to_string : namespace -> string
Get a string representation of a namespace.
val register : namespace -> string -> namespace
register hint kind
creates a new namespace and registers it.
If hint
is not used, it will be used as the new namespace. Otherwise,
some numeral suffix will be appended to it in order to distinguish it.
The kind
is meant to provide information about what kind of namespace
this is. In liquidsoap, it tells which kind of operator owns the namespace,
and hence which commands should be expected in it.
val unregister : namespace -> unit
Release a namespace, deleting all associated commands.
val add : ns:namespace ->
?usage:string -> descr:string -> string -> (string -> string) -> unit
add ~ns ~descr command f
adds a new command command
in a given namespace ~ns.
When the command is called, the function f
is executed with the argument of
the command as parameter. The return value of f
is then displayed. ~descr is
the command description.
val remove : ns:namespace -> string -> unit
Remove a command from the server.
val exec : string -> string
exec command
executes the command
, returns its result.
Raises Not_found
if the command does not exist.