HashFS
This is a simple implementation of content-addressable storage (CAS for short). Files are stored in a write-once-read-many fashion with a hash of the file’s content serving as the key for future references. The system is simple, but very effective for storing data that does not change that much (which are almost all BLOBs).
Features
- Hash addressing is compatible with Git storage
Installation
Add HashFS as a dependency:
def deps do [{:hashfs, "~> 0.3.0"}] end
Add the following code snippet somewhere in your source code:
defmodule MyApp.CAS do use HashFS.Agent, otp_app: :myapp end
Configure the agent:
config :myapp, MyApp.CAS, path: "/var/data/hashfs/myapp"
Make sure the agent is started:
defmodule MyApp.App do use Application # ... children = [ # ... worker(MyApp.CAS, []) ] # ... end