Depot.Adapter.InMemory (Depot v0.5.2) View Source

Depot Adapter using an Agent for in memory storage.

Direct usage

iex> filesystem = Depot.Adapter.InMemory.configure(name: InMemoryFileSystem)
iex> start_supervised(filesystem)
iex> :ok = Depot.write(filesystem, "test.txt", "Hello World")
iex> {:ok, "Hello World"} = Depot.read(filesystem, "test.txt")

Usage with a module

defmodule InMemoryFileSystem do
  use Depot.Filesystem,
    adapter: Depot.Adapter.InMemory
end

start_supervised(InMemoryFileSystem)

InMemoryFileSystem.write("test.txt", "Hello World")
{:ok, "Hello World"} = InMemoryFileSystem.read("test.txt")

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.