NAME
Zing::Repo - Generic Store
ABSTRACT
Generic Store Abstraction
SYNOPSIS
use Zing::Repo;
my $repo = Zing::Repo->new(name => 'repo');
# $repo->recv('text-1');
DESCRIPTION
This package provides a general-purpose data storage abstraction.
LIBRARIES
This package uses type constraints from:
ATTRIBUTES
This package has the following attributes:
name
name(Str)
This attribute is read-only, accepts (Str)
values, and is required.
server
server(Server)
This attribute is read-only, accepts (Server)
values, and is optional.
store
store(Store)
This attribute is read-only, accepts (Store)
values, and is optional.
target
target(Enum[qw(global local)])
This attribute is read-only, accepts (Enum[qw(global local)])
values, and is optional.
METHODS
This package implements the following methods:
drop
drop(Str @keys) : Int
The drop method returns truthy if the data was removed from the store.
ids
ids() : ArrayRef[Str]
The ids method returns a list of IDs (keys) stored under the datastore namespace.
keys
keys() : ArrayRef[Str]
The keys method returns a list of fully-qualified keys stored under the datastore namespace.
term
term(Str @keys) : Str
The term method generates a term (safe string) for the datastore.
test
test(Str @keys) : Int
The test method returns truthy if the specific key (or datastore) exists.
- test example #2
-
# given: synopsis $repo->store->send($repo->term('text-1'), { test => time }); $repo->test('text-1');
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".