README.md

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

1. Add HashFS as a dependency:

    ```elixir
    def deps do
      [{:hashfs, "~> 0.3.0"}]
    end
      ```

2. Add the following code snippet somewhere in your source code:

    ```elixir
    defmodule MyApp.CAS do
      use HashFS.Agent,
        otp_app: :myapp
    end
    ```

3. Configure the agent:

    ```elixir
    config :myapp, MyApp.CAS,
      path: "/var/data/hashfs/myapp"
    ```

4. Make sure the agent is started:

    ```elixir
    defmodule MyApp.App do
      use Application
      # ...
      children = [
        # ...
        worker(MyApp.CAS, [])
      ]
      # ...
    end
    ```