Skip to main content

Module vault

Module vault 

Source
Expand description

Content-addressed file vault on the local file system.

Layout below the vault root:

objects/ab/cd/abcdef0123…   blob named by the SHA-256 of its content
tmp/                         uploads in progress (same file system → atomic rename)
uploads/<session id>         chunked, resumable uploads (services::uploads)

Identical files are stored once, no matter how many revisions reference them. Blobs are never modified after they were written. Storing content that is already there renews the blob’s modification time, so the time says when the blob was last written or stored again: a blob that the database does not refer to yet (an upload between the vault and its database row) is always younger than the grace period of the removal of unreferenced blobs (services::retention).

Structs§

StoredBlob
Result of a completed upload.
StoredObject
A blob found in the vault (see Vault::objects_in).
Upload
An upload in progress. Dropping it without calling Upload::finish deletes the temporary file.
Vault