Belt v0.5.1 Belt.Provider.Filesystem View Source

Provider module offering support for storing files in a directory on the local filesystem.

Link to this section Summary

Types

Options for creating an Filesystem provider

Functions

Creates a new Filesystem provider configuration with default credentials

Implementation of the Belt.Provider.delete/3 callback

Implementation of the Belt.Provider.delete_all/2 callback

Implementation of the Belt.Provider.delete_scope/3 callback

Implementation of the Belt.Provider.get_info/3 callback

Implementation of the Belt.Provider.get_url/3 callback

Implementation of the Belt.Provider.list_files/2 callback

Creates a new Filesystem provider configuration

Implementation of the Belt.Provider.store/3 callback

Implementation of the Belt.Provider.store_data/3 callback

Implementation of the Provider.test_connection/2 callback

Link to this section Types

Link to this type filesystem_option() View Source
filesystem_option() :: {:directory, String.t()} | {:base_url, String.t()}

Options for creating an Filesystem provider.

Link to this section Functions

Link to this function default(options \\ []) View Source
default([filesystem_option()]) ::
  {:ok, Belt.Provider.configuration()} | {:error, term()}

Creates a new Filesystem provider configuration with default credentials.

Any provided options override the default settings which are retrieved from the application configuration.

Example

# config.exs
config :belt, Belt.Provider.Filesystem,
default: [
  directory: "/foo",
  base_url: "https://example.com/"]
Link to this function delete(config, identifier, options) View Source

Implementation of the Belt.Provider.delete/3 callback.

Link to this function delete_all(config, options) View Source

Implementation of the Belt.Provider.delete_all/2 callback.

Link to this function delete_scope(config, scope, options) View Source

Implementation of the Belt.Provider.delete_scope/3 callback.

Link to this function do_list_files(list, files, options) View Source
Link to this function get_info(config, identifier, options) View Source

Implementation of the Belt.Provider.get_info/3 callback.

Link to this function get_url(arg1, identifier, arg3) View Source

Implementation of the Belt.Provider.get_url/3 callback.

Link to this function list_files(config, options) View Source

Implementation of the Belt.Provider.list_files/2 callback.

Creates a new Filesystem provider configuration.

Options

  • :directory (required) - Path.t - path to folder on the file system.
  • :base_url - String.t - URL under which files stored with this configuration are accessible
Link to this function store(config, file_source, options) View Source

Implementation of the Belt.Provider.store/3 callback.

Link to this function store_data(config, iodata, options) View Source

Implementation of the Belt.Provider.store_data/3 callback.

Link to this function test_connection(config, options) View Source

Implementation of the Provider.test_connection/2 callback.