NAME
Zing::Lookup - Domain Lookup Table
ABSTRACT
Domain Lookup Table Construct
SYNOPSIS
use
Zing::Lookup;
my
$lookup
= Zing::Lookup->new(
name
=>
'users'
);
# my $domain = $lookup->set('unique-id');
DESCRIPTION
This package provides an index and lookup-table for Zing::Domain data structures which provides the ability to create a collection of domains with full history of state changes.
INHERITS
This package inherits behaviors from:
LIBRARIES
This package uses type constraints from:
METHODS
This package implements the following methods:
cursor
cursor() : Cursor
The cursor method returns a Zing::Cursor object which provides the ability to page-through and traverse the lookup dataset forwards and backwards.
del
del(Str
$key
) : Lookup
The del method deletes the Zing::Domain associated with a specific key.
- del example #2
-
# given: synopsis
$lookup
->set(
'user-12345'
,
'me@example.com'
);
$lookup
->del(
'user-12345'
);
drop
drop() : Int
The drop method returns truthy if the lookup has been destroyed. This operation does not cascade.
- drop example #2
-
# given: synopsis
$lookup
->set(
'user-12345'
,
'me@example.com'
);
$lookup
->savepoint->
send
;
$lookup
->drop;
get
get(Str
$key
) : Maybe[Domain]
The get method return the Zing::Domain associated with a specific key.
- get example #2
-
# given: synopsis
$lookup
->set(
'user-12345'
)->set(
email
=>
'me@example.com'
);
$lookup
->get(
'user-12345'
);
savepoint
savepoint() : Savepoint
The savepoint method returns a Zing::Savepoint object which provides the ability to save and restore large indices (lookup states). If a lookup has an associated savepoint it will be loaded automatically on object construction.
set
set(Str
$key
) : Domain
The set method creates a Zing::Domain association with a specific key in the lookup. The key must be unique or will overwrite any existing data.
AUTHOR
Al Newkirk, awncorp@cpan.org
LICENSE
Copyright (C) 2011-2019, Al Newkirk, et al.
This is free software; you can redistribute it and/or modify it under the terms of the The Apache License, Version 2.0, as elucidated in the "license file".