SFTP Client v1.0.0 SFTPClient.Adapter.SFTP behaviour View Source

A behavior that defines required callbacks for a low-level SFTP adapter.

Link to this section Summary

Link to this section Callbacks

Link to this callback

close(channel_pid, handle) View Source
close(channel_pid :: pid(), handle :: term()) :: :ok | {:error, any()}

Link to this callback

del_dir(channel_pid, path) View Source
del_dir(channel_pid :: pid(), path :: charlist()) :: :ok | {:error, any()}

Link to this callback

delete(channel_pid, path) View Source
delete(channel_pid :: pid(), path :: charlist()) :: :ok | {:error, any()}

Link to this callback

file_info(channel_pid) View Source
file_info(channel_pid :: pid()) ::
  {:ok, :ssh_sftp.file_info()} | {:error, any()}

Link to this callback

list_dir(channel_pid, path) View Source
list_dir(channel_pid :: pid(), path :: charlist()) ::
  {:ok, [charlist()]} | {:error, any()}
list_dir(channel_pid :: pid(), path :: charlist()) ::
  {:ok, [charlist()]} | {:error, any()}

Link to this callback

list_dir(channel_pid, path) View Source
list_dir(channel_pid :: pid(), path :: charlist()) ::
  {:ok, [charlist()]} | {:error, any()}
list_dir(channel_pid :: pid(), path :: charlist()) ::
  {:ok, [charlist()]} | {:error, any()}

Link to this callback

make_dir(channel_pid, path) View Source
make_dir(channel_pid :: pid(), path :: charlist()) :: :ok | {:error, any()}

Link to this callback

make_symlink(channel_pid, symlink_path, target_path) View Source
make_symlink(
  channel_pid :: pid(),
  symlink_path :: charlist(),
  target_path :: charlist()
) :: :ok | {:error, any()}

Link to this callback

open(channel_pid, path, modes) View Source
open(
  channel_pid :: pid(),
  path :: charlist(),
  modes :: [SFTPClient.access_mode()]
) :: {:ok, term()} | {:error, any()}

Link to this callback

opendir(channel_pid, path) View Source
opendir(channel_pid :: pid(), path :: charlist()) ::
  {:ok, term()} | {:error, any()}

Link to this callback

read(channel_pid, handle, length) View Source
read(channel_pid :: pid(), handle :: term(), length :: non_neg_integer()) ::
  {:ok, binary()} | {:error, any()}

Link to this callback

read_file(channel_pid, path) View Source
read_file(channel_pid :: pid(), path :: charlist()) ::
  {:ok, binary()} | {:error, any()}

Link to this callback

read_file_info(channel_pid, path) View Source
read_file_info(channel_pid :: pid(), path :: charlist()) ::
  {:ok, term()} | {:error, any()}

Link to this callback

read_link(channel_pid, path) View Source
read_link(channel_pid :: pid(), path :: charlist()) ::
  {:ok, charlist()} | {:error, any()}

Link to this callback

readdir(channel_pid, handle) View Source
readdir(channel_pid :: pid(), handle :: term()) ::
  {:ok, binary()} | {:error, any()}

Link to this callback

rename(channel_pid, old_path, new_path) View Source
rename(channel_pid :: pid(), old_path :: charlist(), new_path :: charlist()) ::
  :ok | {:error, any()}

Link to this callback

start_channel(host, port, opts) View Source
start_channel(
  host :: charlist(),
  port :: non_neg_integer(),
  opts :: Keyword.t()
) :: {:ok, pid(), pid()} | {:error, any()}

Link to this callback

stop_channel(channel_pid) View Source
stop_channel(channel_pid :: pid()) :: :ok

Link to this callback

write(channel_pid, path, data) View Source
write(channel_pid :: pid(), path :: charlist(), data :: binary()) ::
  :ok | {:error, any()}

Link to this callback

write_file(channel_pid, path, data) View Source
write_file(channel_pid :: pid(), path :: charlist(), data :: [binary()]) ::
  :ok | {:error, any()}