Belt v0.4.0 Belt.Provider.Filesystem

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

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

Types

filesystem_option()
filesystem_option ::
  {:directory, String.t} |
  {:base_url, String.t}

Options for creating an Filesystem provider.

Functions

default(options \\ [])
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/"]
delete(config, identifier, options)

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

delete_all(config, options)

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

delete_scope(config, scope, options)

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

do_list_files(list, files, options)
get_info(config, identifier, options)

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

get_url(arg1, identifier, arg3)

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

list_files(config, options)

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
store(config, file_source, options)

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

store_data(config, iodata, options)

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

test_connection(config, options)

Implementation of the Provider.test_connection/2 callback.