<<

write_json($file_path, $ref)

Write a JSON file with exclusive file locking

write_canonical_json($file_path, $ref)

Write a JSON file in canonical, indented format without any file locking

read_json_raw($file_path)

Reads from a JSON file with shared file locking. Note returns JSON string, not a hash. Dies on error

read_json($file_path)

Reads from a JSON file with shared file locking. Returns a hash. Dies on error

store_object ($path, $ref)

Serializes an object in our preferred object store, removing it from legacy storage if it is present. Tries to emulate [Storable](https://metacpan.org/dist/Storable/source/Storable.pm) behavior but uses die instead of croak

retrieve_object($path)

Fetch the JSON object from storage and return as a hash ref. Reverts to STO file if no JSON file exists. Will die if JSON is malformed.

retrieve_object_json($path)

Fetch the JSON object from storage and return as a JSON string. Reverts to STO file and serializes as JSON if no JSON file exists

object_exists($path)

Indicates whether an object (STO or JSON) exists at the specified path

object_path_exists($path)

Indicates whether an directory exists at the specified path

move_object($old_path, $new_path)

Moves a single object or all objects in the path

link_object($name, $link)

Makes the $link point to the data in the specified relative $path. If the object at the $path is an sto file then an STO symbolic link will be created

remove_object($path)

Removes an object or link to an object

object_iter($initial_path, $name_pattern = undef, $exclude_path_pattern = undef)

Iterates over the path returning a cursor that can return object paths whose name matches the $name_pattern regex and whose path does not match the $exclude_path_pattern

store_config ($path, $ref)

Serializes configuration information, removing it from legacy storage if it is present. JSON keys are sorted and indentation is used so files can be used in source control No locking is performed

retrieve_config($path)

Same as retrieve_object but with no locking

<<