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

Behaviour of a Depot filesystem.

Link to this section Summary

Link to this section Callbacks

Link to this callback

copy(source, destination, opts)

View Source

Specs

copy(source :: Path.t(), destination :: Path.t(), opts :: keyword()) ::
  :ok | {:error, term()}

Specs

delete(path :: Path.t(), opts :: keyword()) :: :ok | {:error, term()}

Specs

file_exists(path :: Path.t(), opts :: keyword()) ::
  {:ok, :exists | :missing} | {:error, term()}
Link to this callback

list_contents(path, opts)

View Source

Specs

list_contents(path :: Path.t(), opts :: keyword()) ::
  {: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(source, destination, opts)

View Source

Specs

move(source :: Path.t(), destination :: Path.t(), opts :: keyword()) ::
  :ok | {:error, term()}

Specs

read(path :: Path.t(), opts :: keyword()) :: {:ok, binary()} | {:error, term()}

Specs

read_stream(path :: Path.t(), opts :: keyword()) ::
  {:ok, Enumerable.t()} | {:error, term()}
Link to this callback

write(path, contents, opts)

View Source

Specs

write(path :: Path.t(), contents :: binary(), opts :: keyword()) ::
  :ok | {:error, term()}

Link to this section Functions

Link to this function

merge_app_env(opts, module)

View Source
Link to this function

parse_opts(module, opts)

View Source