Coelho.Storage.Disk (coelho v0.3.1)

Copy Markdown View Source

Attachment bytes on the local filesystem.

Enough to run an application on one machine, and to have something concrete to point Coelho.Attachments at while the storage question is still open:

storage = Coelho.Storage.Disk.new("priv/uploads")

Files are sharded on the first two characters of the key, because a single directory holding every attachment stops being a good idea sooner than people expect.

Summary

Functions

A storage rooted at root, which is created on first write.

Types

t()

@type t() :: %Coelho.Storage.Disk{root: Path.t()}

Functions

new(root)

@spec new(Path.t()) :: t()

A storage rooted at root, which is created on first write.