class Bakelite::FS::Registry

Overview

Concrete registry implementation managing volumes and union routing

Defined in:

bakelite/dsl/verify_archive_builder.cr
bakelite/fs.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new #

[View source]

Instance Method Detail

def [](path : String) : Item #

[View source]
def []?(path : String) : Item | Nil #

[View source]
def content_address : String #

Canonical content address URI for this registry's manifest ("sha256:").


[View source]
def content_manifest : Hash(String, String) #

Returns a deterministically sorted map of visible union virtual paths to SHA-256 hex digests.


[View source]
def each_file(&block : Item -> ) : Nil #

Iterates over all visible unique items in union priority order.


[View source]
def extract_all(destination_dir : Path | String, overwrite : Bool = true) : Int32 #

Extracts all visible union files into destination_dir on disk.


[View source]
def extract_folder(prefix : String, destination_dir : Path | String, overwrite : Bool = true) : Int32 #

Extracts all visible files matching virtual prefix into destination_dir.


[View source]
def extract_volume(name : Symbol | String, destination_dir : Path | String, overwrite : Bool = true) : Int32 #

Extracts all files from a specific volume into destination_dir on disk.


[View source]
def extract_volume_folder(name : Symbol | String, prefix : String, destination_dir : Path | String, overwrite : Bool = true) : Int32 #

Extracts a specific subfolder from a specific volume into destination_dir on disk.


[View source]
def files : Array(String) #

Returns an array of all virtual paths visible through the union router.


[View source]
def find_all_by_sha256(digest : String) : Array(Item) #

Finds all visible items matching a SHA-256 content address (in deterministic virtual path order).


[View source]
def find_by_sha256(digest : String) : Item | Nil #

Finds the first visible item (in deterministic virtual path order) matching a SHA-256 content address.


[View source]
def get(path : String) : Item #

Queries a path, raising KeyError if not found in any mounted volume.


[View source]
def get?(path : String) : Item | Nil #

Queries a path across all mounted volumes using union routing. Volumes with higher priority shadow lower-priority volumes.


[View source]
def get_by_sha256(digest : String) : Item #

Fetches a visible item by its SHA-256 content address, raising KeyError if not found.


[View source]
def get_by_sha256?(digest : String) : Item | Nil #

Alias for find_by_sha256.


[View source]
def glob(pattern : String, &block : Item -> ) : Nil #

Matches all visible files using glob patterns.


[View source]
def glob(pattern : String) : Array(Item) #

[View source]
def has_file?(path : String) : Bool #

[View source]
def has_sha256?(digest : String) : Bool #

Checks whether a visible item with the given SHA-256 content address exists in this registry.


[View source]
def manifest_sha256 : String #

Computes a deterministic SHA-256 manifest digest over all visible union files in this registry.


[View source]
def mount(volume : Volume) : Volume #

Mounts a volume into this registry. Re-sorts volumes by priority descending.


[View source]
def mount_file(archive_path : String | Path, volume_name : Symbol | String | Nil = nil, mount : String | Nil = nil, priority : Int32 = 0) : Volume | Nil #

Mounts an external .bkl archive file or executable overlay


[View source]
def mount_self!(priority : Int32 = 0) : Bool #

Automatically inspects Process.executable_path for appended Bakelite volumes


[View source]
def open(path : String) : IO #

[View source]
def open(path : String, &block : IO -> T) : T forall T #

[View source]
def root_volume : Volume #

Default root volume for direct bakes without explicit volume declaration.


[View source]
def sha256 : String #

Alias for manifest_sha256.


[View source]
def unmount(volume_name : Symbol | String) : Bool #

Unmounts a volume by its identifier. Cannot unmount root volume.


[View source]
def verify_archive(raise_on_error : Bool = false, expected_digests : Hash(String, String) | Nil = nil, expected_manifest_sha256 : String | Nil = nil, strict : Bool = false) : Core::VerificationReport #

Verifies the SHA-256 and CRC32 integrity of all visible items in this registry.


[View source]
def verify_archive(raise_on_error : Bool = false, &) : Core::VerificationReport #

[View source]
def verify_archive! : Core::VerificationReport #

[View source]
def verify_archive!(&) : Core::VerificationReport #

[View source]
def volume(name : Symbol | String) : Volume #

Retrieves a volume by name. Raises KeyError if missing.


[View source]
def volume?(name : Symbol | String) : Volume | Nil #

Retrieves a volume by name, returning nil if missing.


[View source]
def volumes : Array(Volume) #

[View source]