FileStore.Adapters.Disk (file_store v0.3.0) View Source

Stores files on the local disk. This is primarily intended for development.

Configuration

  • storage_path - The path on disk where files are stored. This option is required.

  • base_url - The base URL that should be used for generating URLs to your files.

Example

iex> store = FileStore.Adapters.Disk.new(
...>   storage_path: "/path/to/store/files",
...>   base_url: "http://example.com/files/"
...> )
%FileStore.Adapters.Disk{...}

iex> FileStore.write(store, "foo", "hello world")
:ok

iex> FileStore.read(store, "foo")
{:ok, "hello world"}

Link to this section Summary

Functions

Get an the path for a given key.

Create a new disk adapter

Link to this section Functions

Specs

join(FileStore.t(), binary()) :: Path.t()

Get an the path for a given key.

Specs

new(keyword()) :: FileStore.t()

Create a new disk adapter