Depot v0.2.1 Depot.Adapter behaviour View Source

Behaviour for how Depot adapters work.

Link to this section Summary

Link to this section Types

Specs

config()

Specs

path() :: Path.t()

Link to this section Callbacks

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()}

Specs

delete(config(), path()) :: :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()}

Specs

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

write(config, path, contents)

View Source

Specs

write(config(), path(), contents :: iodata()) :: :ok | {:error, term()}