diff options
author | franck cuny <franck@lumberjaph.net> | 2009-12-14 12:08:16 +0100 |
---|---|---|
committer | franck cuny <franck@lumberjaph.net> | 2009-12-14 12:08:16 +0100 |
commit | dea9976500a49779fc93207b842edc7623f8e515 (patch) | |
tree | 9feb280406e19f2a940fb980369701acadea0292 | |
parent | run tests only if a server is available (diff) | |
download | anyevent-riak-dea9976500a49779fc93207b842edc7623f8e515.tar.gz |
POD
-rw-r--r-- | lib/AnyEvent/Riak.pm | 53 |
1 files changed, 52 insertions, 1 deletions
diff --git a/lib/AnyEvent/Riak.pm b/lib/AnyEvent/Riak.pm index 0f9d66e..5d180d6 100644 --- a/lib/AnyEvent/Riak.pm +++ b/lib/AnyEvent/Riak.pm @@ -164,7 +164,7 @@ AnyEvent::Riak - Non-blocking Riak client path => 'jiak', ); - my $buckets = $riak->list_bucket('namespace')->recv; + my $buckets = $riak->list_bucket('bucketname')->recv; my $new_bucket = $riak->set_bucket('foo', {allowed_fields => '*'})->recv; my $store = $riak->store({bucket => 'foo', key => 'bar', object => {baz => 1},link => []})->recv; my $fetch = $riak->fetch('foo', 'bar')->recv; @@ -178,6 +178,57 @@ AnyEvent::Riak is a non-blocking riak client using anyevent. =over 4 +=item B<list_bucket> + +Get the schema and key list for 'bucket' + + $riak->list_bucket('bucketname')->recv; + +=item B<set_bucket> + +Set the schema for 'bucket'. The schema parameter must be a hash with at least +an 'allowed_fields' field. Other valid fields are 'requried_fields', +'read_mask', and 'write_mask'. + + $riak->new_bucket('bucketname', {allowed_fields => '*'})->recv; + +=item B<fetch> + +Get the object stored in 'bucket' at 'key'. + + $riak->fetch('bucketname', 'key')->recv; + +=item B<store> + +Store 'object' in Riak. If the object has not defined its 'key' field, a key +will be chosen for it by the server. + + $riak->store({ + bucket => 'bucketname', + key => 'key', + object => { foo => "bar", baz => 2 }, + links => [], + })->recv; + +=item B<delete> + +Delete the data stored in 'bucket' at 'key'. + + $riak->delete('bucketname', 'key')->recv; + +=item B<walk> + +Follow links from the object stored in 'bucket' at 'key' to other objects. +The 'spec' parameter should be an array of hashes, each hash optinally +defining 'bucket', 'tag', and 'acc' fields. If a field is not defined in a +spec hash, the wildcard '_' will be used instead. + + ok $res = $jiak->walk( + 'bucketname', + 'key', + [ { bucket => 'bucketname', key => '_' } ] + )->recv; + =back =head1 AUTHOR |