Mate.Driver behaviour (Mate v0.1.5) View Source
This is the behaviour for Mate Drivers.
The idea behind supporting multiple drivers is allowing the user to decide
how and where they want to build their application. By default is will use
the SSH driver, but maybe in the near future there will be other built-in
drivers. It is also possible to write your own, of course. For an example I
recommend looking at Mate.Driver.SSH
.
NOTE: Deployments currently always use the Mate.Driver.SSH
.
Link to this section Summary
Callbacks
This one is optional and can be used to close the current connection, cleanup or whatever else might be needed.
Copy a file from remote to local
Copy a file from local to remote
Returns a description of the current host (defaults to context hostname)
Executes a command using the driver
Executes a script using the driver
Prepare source
Starts the driver, for example create an SSH connection, start a docker container, or whatever else might be needed for your new session.
Link to this section Callbacks
Specs
close(session :: Mate.Session.t()) :: {:ok, Mate.Session.t()}
This one is optional and can be used to close the current connection, cleanup or whatever else might be needed.
Specs
copy_from(session :: Mate.Session.t(), src :: String.t(), dest :: String.t()) :: {:ok, String.t()} | {:error, String.t()}
Copy a file from remote to local
Specs
copy_to(session :: Mate.Session.t(), src :: String.t(), dest :: String.t()) :: {:ok, String.t()} | {:error, String.t()}
Copy a file from local to remote
Specs
current_host(session :: Mate.Session.t()) :: String.t()
Returns a description of the current host (defaults to context hostname)
Specs
exec(session :: Mate.Session.t(), command :: String.t(), args :: [String.t()]) :: {:ok, String.t()} | {:error, String.t()}
Executes a command using the driver
Specs
exec_script(session :: Mate.Session.t(), script :: String.t()) :: {:ok, String.t()} | {:error, String.t()}
Executes a script using the driver
Specs
prepare_source(session :: Mate.Session.t()) :: {:ok, Mate.Session.t()} | {:error, String.t()}
Prepare source
Specs
start(session :: Mate.Session.t(), host :: String.t()) :: {:ok, Mate.Session.t()} | {:error, String.t()}
Starts the driver, for example create an SSH connection, start a docker container, or whatever else might be needed for your new session.