HashFS v0.2.0 HashFS

HashFS is a small library providing a content-addressable file system. This is the documentation generated from the source.

Summary

Functions

Get a new File with the contents corresponding to the calculated hash

Same as retrieve/2 but raises an error when something went wrong

Import a file into the repository by giving a reference to its location

Store a file. The file’s content is given by input, which is a Stream, and a length in bytes

Same as store/2, but raises an error when something went wrong

The same as store/3, except that this raises an error when something went wrong

Functions

has(fs, hash)
new(path)
retrieve(fs, hash)

Get a new File with the contents corresponding to the calculated hash.

retrieve!(fs, path)

Same as retrieve/2 but raises an error when something went wrong.

store(fs, path)

Import a file into the repository by giving a reference to its location.

store(fs, input, length)

Store a file. The file’s content is given by input, which is a Stream, and a length in bytes.

store!(fs, path)

Same as store/2, but raises an error when something went wrong.

store!(fs, input, length)

The same as store/3, except that this raises an error when something went wrong.