dream_http_client/storage

File I/O for recordings

Handles loading and saving recording files to/from the filesystem.

Values

pub fn load_recordings(
  directory: String,
) -> Result(List(recording.Recording), String)

Load recordings from a JSON file

Returns an empty list if the file doesn’t exist (for playback mode, this means no recordings are available).

pub fn save_recordings(
  directory: String,
  recordings: List(recording.Recording),
) -> Result(Nil, String)

Save recordings to a JSON file

Creates the directory if it doesn’t exist and writes all recordings to a single JSON file.

Search Document