# ExfileB2

[![Build Status](](

A [Backblaze B2]( adapter for [Exfile](

ExfileB2 uses a local file-based cache to speed up file accesses and reduce bandwidth
needs especially when doing processing. The default maximum is 100 MB, you can
configure this to any amount you need.

The B2 client is currently built in to this package. There are plans to break it out as its own
package in the near future. Stay tuned.

Requires Elixir ~> 1.2.

## Installation

  1. Add exfile_b2 to your list of dependencies in `mix.exs`:

        def deps do
            {:exfile, "~> 0.3.1"},
            {:exfile_b2, "~> 0.2.0"}

  2. Ensure exfile_b2 is started before your application:

        def application do
            applications: [

  3. Configure the backend in `config.exs` (or environment equivalent)

        config :exfile, Exfile,
          backends: %{
            "store" => {ExfileB2.Backend,
              hasher: Exfile.Hasher.Random,
              account_id: "the Account ID to your B2 account",
              application_key: "the Application Key to your B2 account",
              bucket: "name of the bucket to store files"

  4. Configure ExfileB2's local cache maximum size (optional, default 100 MB)

        config :exfile_b2, :local_cache_size, 100_000_000 # bytes