SFTPClient.Adapter.SFTP behaviour (SFTP Client v1.4.6) 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, timeout)

View Source

Specs

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

del_dir(channel_pid, path, timeout)

View Source

Specs

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

delete(channel_pid, path, timeout)

View Source

Specs

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

list_dir(channel_pid, path, timeout)

View Source

Specs

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

make_dir(channel_pid, path, timeout)

View Source

Specs

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

Specs

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

Specs

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

Specs

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

read(channel_pid, handle, length, timeout)

View Source

Specs

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

Specs

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

Specs

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

Specs

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

readdir(channel_pid, handle, timeout)

View Source

Specs

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

Specs

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

Specs

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

Specs

stop_channel(channel_pid :: pid()) :: :ok
Link to this callback

write(channel_pid, path, data, timeout)

View Source

Specs

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

Specs

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