logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Catmandu::DirectoryIndex::UUID - A uuid based path translator

Inherited Methods

       This Catmandu::DirectoryIndex::Number implements:

       Catmandu::DirectoryIndex

Limitations

       The keys in this directory can only be UUID identifiers.

Methods

new(base_dir=>$base_dir)
       Create a new Catmandu::DirectoryIndex::UUID with the following configuration parameters:

       base_dir
           See Catmandu::DirectoryIndex

Name

       Catmandu::DirectoryIndex::UUID - A uuid based path translator

See Also

       Catmandu::DirectoryIndex

perl v5.40.0                                       2025-01-17                Catmandu::DirectoryIndex::UUID(3pm)

Synopsis

           use Catmandu::DirectoryIndex::UUID;

           my $p = Catmandu::DirectoryIndex::UUID->new(
               base_dir => "/data"
           );

           # Returns mapping like { _id  => "9A581C80-1189-11E8-AB6D-46BC153F89DB", "/data/9A5/81C/80-/118/9-1/1E8/-AB/6D-/46B/C15/3F8/9DB" }
           # Can be undef
           my $mapping = $p->get("9A581C80-1189-11E8-AB6D-46BC153F89DB");

           # Create path and return mapping
           my $mapping = $p->add("9A581C80-1189-11E8-AB6D-46BC153F89DB");

           # Catmandu::DirectoryIndex::Number is a Catmandu::Iterable
           # Returns list of records: [{ _id => 1234, _path => "/data/000/001/234" }]
           my $mappings = $p->to_array();

See Also