Depot.Adapter behaviour (Depot v0.5.1) 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()

Link to this section Callbacks

Specs

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

Specs

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

copy(config, source, destination)

View Source

Specs

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

copy(source_config, source, destination_config, destination)

View Source

Specs

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

create_directory(config, path)

View Source

Specs

create_directory(config(), path()) :: :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()}
     | %Depot.Stat.File{mtime: term(), name: term(), size: term()}
   ]}
  | {:error, term()}
Link to this callback

move(config, source, destination)

View Source

Specs

move(config(), source :: path(), destination :: path()) ::
  :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()}

Specs

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

write(config, path, contents)

View Source

Specs

write(config(), path(), contents :: iodata()) :: :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()}