realbook v0.2.1 Realbook.Adapters.Api behaviour View Source
common interface for communications adapters between the local machine and the remote deployment target.
All realbook command macros adapt this interface to perform the relevant commands.
For example code, see:
Link to this section Summary
Types
A token that represents the remote deployment target.
allows you to select a stored key for content or file name
Link to this section Types
Link to this section Callbacks
Specs
append(conn(), binary() | Enumerable.t(), Path.t(), options :: keyword()) :: :ok | {:error, :file.posix()}
appends a binary or a file to the remote server.
NB: options might take the :sudo
options, which should be filtered
prior to sending the contents.
Specs
connects into the remote target and produces a conn/0
token.
NB: for Realbook.Adapters.SSH
the host parameter will live in this
variable.
Specs
run(conn(), String.t(), options :: keyword()) :: {:ok, String.t(), non_neg_integer()} | {:error, String.t() | :file.posix()}
executes a unix command on the remote target.
Warning:
this may or may not support piping operations, depending on the underlying implementation. The guidelines for running pipes may change in the future.
Specs
send(conn(), binary() | Enumerable.t(), Path.t(), options :: keyword()) :: :ok | {:error, :file.posix()}
sends a binary or a file to the remote server.
NB: options might take the :sudo
options, which should be filtered
prior to sending the contents.