Jido.VFS.Adapter.InMemory (Jido.VFS v1.0.0)

View Source

Jido.VFS Adapter using an Agent for in memory storage.

Direct usage

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

Usage with a module

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

start_supervised(InMemoryFileSystem)

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

Summary

Functions

Returns a specification to start this module under a supervisor.

Functions

child_spec(arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(config)