Jido. VFS. Filesystem behaviour
(Jido.VFS v1.0.0)
View Source
Behaviour and delegation helpers for a Jido.VFS filesystem module.
Summary
Callbacks
Copies a file from one relative path to another.
Deletes the file at the given relative path.
Checks whether the given relative path exists.
Lists the directory entries for the given relative path.
Moves a file from one relative path to another.
Reads the file at the given relative path.
Opens a readable stream for the file at the given relative path.
Writes contents to the given relative path.
Functions
Injects a filesystem wrapper module backed by a configured adapter.
Merges adapter options with application environment overrides when :otp_app is present.
Merges compile-time options with module-specific runtime configuration and extracts the adapter.
Callbacks
@callback copy(source :: Path.t(), destination :: Path.t(), opts :: keyword()) :: :ok | {:error, term()}
Copies a file from one relative path to another.
Deletes the file at the given relative path.
@callback file_exists(path :: Path.t(), opts :: keyword()) :: {:ok, :exists | :missing} | {:error, term()}
Checks whether the given relative path exists.
@callback list_contents(path :: Path.t(), opts :: keyword()) :: {:ok, [ %Jido.VFS.Stat.Dir{ mtime: term(), name: term(), size: term(), visibility: term() } | %Jido.VFS.Stat.File{ mtime: term(), name: term(), size: term(), visibility: term() } ]} | {:error, term()}
Lists the directory entries for the given relative path.
@callback move(source :: Path.t(), destination :: Path.t(), opts :: keyword()) :: :ok | {:error, term()}
Moves a file from one relative path to another.
Reads the file at the given relative path.
@callback read_stream(path :: Path.t(), opts :: keyword()) :: {:ok, Enumerable.t()} | {:error, term()}
Opens a readable stream for the file at the given relative path.
@callback write(path :: Path.t(), contents :: binary(), opts :: keyword()) :: :ok | {:error, term()}
Writes contents to the given relative path.
Functions
Injects a filesystem wrapper module backed by a configured adapter.
Merges adapter options with application environment overrides when :otp_app is present.
Merges compile-time options with module-specific runtime configuration and extracts the adapter.