Depot.Adapter behaviour (Depot v0.5.2) View Source

Behaviour for how Depot adapters work.

Link to this section Summary

Link to this section Types

Specs

config() :: struct()
Link to this type

directory_delete_opts()

View Source

Specs

directory_delete_opts() :: keyword()

Specs

path() :: Path.t()

Specs

stream_opts() :: keyword()

Specs

write_opts() :: keyword()

Link to this section Callbacks

Specs

clear(config()) :: :ok | {:error, term()}

Specs

configure(keyword()) :: {module(), config()}
Link to this callback

copy(config, source, destination, write_opts)

View Source

Specs

copy(config(), source :: path(), destination :: path(), write_opts()) ::
  :ok | {:error, term()}
Link to this callback

copy(source_config, source, destination_config, destination, write_opts)

View Source

Specs

copy(
  source_config :: config(),
  source :: path(),
  destination_config :: config(),
  destination :: path(),
  write_opts()
) :: :ok | {:error, term()}
Link to this callback

create_directory(config, path, write_opts)

View Source

Specs

create_directory(config(), path(), write_opts()) :: :ok | {:error, term()}

Specs

delete(config(), path()) :: :ok | {:error, term()}
Link to this callback

delete_directory(config, path, directory_delete_opts)

View Source

Specs

delete_directory(config(), path(), directory_delete_opts()) ::
  :ok | {:error, term()}
Link to this callback

file_exists(config, path)

View Source

Specs

file_exists(config(), path()) :: {:ok, :exists | :missing} | {:error, term()}
Link to this callback

list_contents(config, path)

View Source

Specs

list_contents(config(), path()) ::
  {:ok,
   [
     %Depot.Stat.Dir{
       mtime: term(),
       name: term(),
       size: term(),
       visibility: term()
     }
     | %Depot.Stat.File{
         mtime: term(),
         name: term(),
         size: term(),
         visibility: term()
       }
   ]}
  | {:error, term()}
Link to this callback

move(config, source, destination, write_opts)

View Source

Specs

move(config(), source :: path(), destination :: path(), write_opts()) ::
  :ok | {:error, term()}

Specs

read(config(), path()) :: {:ok, binary()} | {:error, term()}
Link to this callback

read_stream(config, path, stream_opts)

View Source

Specs

read_stream(config(), path(), stream_opts()) ::
  {:ok, Enumerable.t()} | {:error, term()}
Link to this callback

set_visibility(config, path, t)

View Source

Specs

set_visibility(config(), path(), Depot.Visibility.t()) :: :ok | {:error, term()}

Specs

starts_processes() :: boolean()
Link to this callback

visibility(config, path)

View Source

Specs

visibility(config(), path()) :: {:ok, Depot.Visibility.t()} | {:error, term()}
Link to this callback

write(config, path, contents, write_opts)

View Source

Specs

write(config(), path(), contents :: iodata(), write_opts()) ::
  :ok | {:error, term()}
Link to this callback

write_stream(config, path, stream_opts)

View Source

Specs

write_stream(config(), path(), stream_opts()) ::
  {:ok, Collectable.t()} | {:error, term()}