Module Ketrew_pure.Host

module Host: sig .. end


Definition of a host; a place to run commands or handle files.
module Ssh: sig .. end
Definitions specific to “SSH” hosts (see 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
Specification of the default shell of a Host.
type t 
val to_yojson : t -> Yojson.Safe.json
val of_yojson : Yojson.Safe.json -> t Ppx_deriving_yojson_runtime.error_or
Host container.

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
Use 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
The host "localhost" (i.e. not over SSH).
val tmp_on_localhost : t
The host "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
Create an SSH host.
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
Get a 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:

For example 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
Parse an RFC-3986-compliant string into a host, see Ketrew_pure.Host.of_uri.
val to_uri : t -> Internal_pervasives.Uri.t
Convert a Host.t to an URI representing it.
val to_string_hum : t -> string
Get a display-friendly string for the host.
val log : t -> Internal_pervasives.Log.t
Get a Log.t document.
val markup : t -> Internal_pervasives.Display_markup.t
Get a higher-level display document.
val execution_timeout : t -> Internal_pervasives.Time.t option
The execution timeout configured for the host.
val connection : t -> [ `Localhost | `Ssh of Ssh.t ]
val playground : t -> Path.t option