module Host:sig
..end
module Ssh:sig
..end
Ketrew_pure.Host.connection
).
type
default_shell
val default_shell_to_yojson : default_shell -> Yojson.Safe.json
val default_shell_of_yojson : Yojson.Safe.json ->
default_shell Ppx_deriving_yojson_runtime.error_or
type
t
val to_yojson : t -> Yojson.Safe.json
val of_yojson : Yojson.Safe.json -> t Ppx_deriving_yojson_runtime.error_or
A host is the current machine, or an SSH-accessed distant host.
It may have a plaground: a directory where Ketrew can create runtime-files.
It keeps track of a default-shell to use (the “default” default_shell
, is
("sh", "-c")
).
val default_shell : ?binary:string ->
?options:string list ->
?command_option:string -> string -> default_shell
default_shell ~binary:"/bin/sh" ~options:["-l"; "--something"; "blah" ]
~command_option:"-c" "sh"
to define a default-shell calling "sh -l --something blah -c <command>"
.val localhost : ?execution_timeout:Internal_pervasives.Time.t ->
?default_shell:default_shell ->
?playground:Path.t -> ?name:string -> unit -> t
"localhost"
(i.e. not over SSH).val tmp_on_localhost : t
"localhost"
, with "/tmp"
as playground
.val ssh : ?execution_timeout:Internal_pervasives.Time.t ->
?add_ssh_options:string list ->
?default_shell:default_shell ->
?playground:Path.t ->
?port:int -> ?user:string -> ?name:string -> string -> t
val shell_of_default_shell : t -> string -> string list
val of_uri : Internal_pervasives.Uri.t ->
(t, [> `Host_uri_parsing_error of string * string ])
Pvem.Result.t
Host.t
from an URI (library ocaml-uri);
the “path” part of the URI is the playground.
Optional arguments can be added to the URL:
"shell"
argument defines the default_shell
."ssh-option"
parameters can be added for SSH-based host, they
add options to SSH/SCP calls."timeout"
value can be defined (in seconds) for all system/SSH calls.of_string "ssh://user@SomeHost:42/tmp/pg?shell=bash,-l,--init-file,bouh,-c&timeout=42"
will be like using
ssh ~default_shell:(default_shell "bash"
~command_name ~options:["-l"; "--init-file"; "bouh"]
~command_option:"-c")
~execution_timeout:42.
~port:42 ~user:"user" "SomeHost"
val of_string : string ->
(t, [> `Host_uri_parsing_error of string * string ])
Pvem.Result.t
val to_uri : t -> Internal_pervasives.Uri.t
Host.t
to an URI representing it.val to_string_hum : t -> string
val log : t -> Internal_pervasives.Log.t
Log.t
document.val markup : t -> Internal_pervasives.Display_markup.t
val execution_timeout : t -> Internal_pervasives.Time.t option
val connection : t -> [ `Localhost | `Ssh of Ssh.t ]
val playground : t -> Path.t option