View Source SFTPClient.Adapter.SFTP behaviour (SFTP Client v2.0.1)

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

Summary

Callbacks

Link to this callback

close(channel_pid, handle, timeout)

View Source
@callback close(channel_pid :: pid(), handle :: term(), timeout()) ::
  :ok | {:error, any()}
Link to this callback

del_dir(channel_pid, path, timeout)

View Source
@callback del_dir(channel_pid :: pid(), path :: charlist(), timeout()) ::
  :ok | {:error, any()}
Link to this callback

delete(channel_pid, path, timeout)

View Source
@callback delete(channel_pid :: pid(), path :: charlist(), timeout()) ::
  :ok | {:error, any()}
Link to this callback

list_dir(channel_pid, path, timeout)

View Source
@callback list_dir(channel_pid :: pid(), path :: charlist(), timeout()) ::
  {:ok, [charlist()]} | {:error, any()}
@callback list_dir(channel_pid :: pid(), path :: charlist(), timeout()) ::
  {:ok, [charlist()]} | {:error, any()}
Link to this callback

make_dir(channel_pid, path, timeout)

View Source
@callback make_dir(channel_pid :: pid(), path :: charlist(), timeout()) ::
  :ok | {:error, any()}
Link to this callback

make_link(channel_pid, symlink_path, target_path, timeout)

View Source
@callback make_link(
  channel_pid :: pid(),
  symlink_path :: charlist(),
  target_path :: charlist(),
  timeout()
) :: :ok | {:error, any()}
Link to this callback

open(channel_pid, path, modes, timeout)

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

opendir(channel_pid, path, timeout)

View Source
@callback opendir(channel_pid :: pid(), path :: charlist(), timeout()) ::
  {:ok, term()} | {:error, any()}
Link to this callback

read(channel_pid, handle, length, timeout)

View Source
@callback read(
  channel_pid :: pid(),
  handle :: term(),
  length :: non_neg_integer(),
  timeout()
) :: {:ok, binary()} | :eof | {:error, any()}
Link to this callback

read_file(channel_pid, path, timeout)

View Source
@callback read_file(channel_pid :: pid(), path :: charlist(), timeout()) ::
  {:ok, binary()} | {:error, any()}
Link to this callback

read_file_info(channel_pid, path, timeout)

View Source
@callback read_file_info(channel_pid :: pid(), path :: charlist(), timeout()) ::
  {:ok, term()} | {:error, any()}
Link to this callback

read_link(channel_pid, path, timeout)

View Source
@callback read_link(channel_pid :: pid(), path :: charlist(), timeout()) ::
  {:ok, charlist()} | {:error, any()}
Link to this callback

readdir(channel_pid, handle, timeout)

View Source
@callback readdir(channel_pid :: pid(), handle :: term(), timeout()) ::
  {:ok, binary()} | {:error, any()}
Link to this callback

rename(channel_pid, old_path, new_path, timeout)

View Source
@callback rename(
  channel_pid :: pid(),
  old_path :: charlist(),
  new_path :: charlist(),
  timeout()
) :: :ok | {:error, any()}
Link to this callback

start_channel(host, port, opts)

View Source
@callback 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
@callback stop_channel(channel_pid :: pid()) :: :ok
Link to this callback

write(channel_pid, path, data, timeout)

View Source
@callback write(channel_pid :: pid(), path :: charlist(), data :: binary(), timeout()) ::
  :ok | {:error, any()}
Link to this callback

write_file(channel_pid, path, data, timeout)

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