Bedrock.ObjectStorage.LocalFilesystem (bedrock v0.5.2)

View Source

Local filesystem implementation of the ObjectStorage behaviour.

This backend stores objects as files on the local filesystem, useful for development and testing. The directory structure mirrors the object keys.

Configuration

  • :root - Required. The root directory for storing objects.

Example

backend = ObjectStorage.backend(ObjectStorage.LocalFilesystem, root: "/tmp/objects")
:ok = ObjectStorage.put(backend, "test/key", "data")
{:ok, "data"} = ObjectStorage.get(backend, "test/key")