Reqord.Storage.FileSystem (reqord v0.4.0)

View Source

FileSystem storage backend implementation.

This module provides file-based storage for cassette entries using JSONL format. It implements streaming reads/writes for memory efficiency and provides atomic operations for concurrent safety.

Summary

Functions

Delete an entire cassette file.

Delete an external object.

Ensure the directory structure for a cassette path exists.

Check if a cassette exists at the specified path.

List all stored objects.

Load a binary object from the objects directory.

Load stream chunks from the streams directory.

Stream all entries from the specified cassette file. Returns a Stream that lazily reads and parses JSONL entries.

Store a binary object in the objects directory.

Store stream chunks in the streams directory.

Write a single entry to the specified cassette file. Appends to the file in JSONL format.

Functions

delete_cassette(path)

Delete an entire cassette file.

delete_object(hash)

Delete an external object.

ensure_path_exists(path)

Ensure the directory structure for a cassette path exists.

exists?(path)

Check if a cassette exists at the specified path.

list_objects()

List all stored objects.

load_object(hash)

Load a binary object from the objects directory.

load_stream(hash)

Load stream chunks from the streams directory.

read_entries(path)

Stream all entries from the specified cassette file. Returns a Stream that lazily reads and parses JSONL entries.

store_object(hash, content)

Store a binary object in the objects directory.

store_stream(hash, chunks)

Store stream chunks in the streams directory.

write_entry(path, entry)

Write a single entry to the specified cassette file. Appends to the file in JSONL format.