class

TransFS::CAS

Inherits Reference < Object

Content-addressable blob store. Blobs live at <root>/blobs/<hh>/<hex>, keyed on the SHA-256 of their content alone — no extension, no name, no document id in the path (see docs/architecture.md §2). <hh> is the first two hex chars, a 256-way fan-out.

Constructors

new(root : String)
Source

Instance methods

blobs_dir
Source
exists?(hex : String) : Bool
Source
get(hex : String) : Bytes | Nil
Source
path_for(hex : String) : String

The on-disk path a hex hash resolves to — a pure function of the hash, identical on every machine (the CAS "the hash is the address" property).

Source
put(content : Bytes) : String

Store content, returning its hex hash. Dedups: identical bytes hash to the same path, so a re-store is a no-op. Writes to a temp file then renames, so a reader never sees a half-written blob.

Source