Git Product home page Git Product logo

cache-kyototycoon-rest's Introduction

NAME

Cache::KyotoTycoon::REST - Client library for KyotoTycoon RESTful API

SYNOPSIS

use Cache::KyotoTycoon::REST;

my $kt = Cache::KyotoTycoon::REST->new(host => $host, port => $port);
$kt->put("foo", "bar", 100); # store key "foo" and value "bar".
$kt->get("foo"); # => "bar"
$kt->delete("foo"); # remove key

DESCRIPTION

Cache::KyotoTycoon::REST is client library for KyotoTycoon RESTful API.

CONSTRUCTOR

  • port

  • host

  • timeout

  • db

Database name or number.

METHODS

  • my $val = $kt->get($key);

Retrieve the value for a $key. $key should be a scalar.

Return: value associated with the $key and $expires time in RFC1123 date format of GMT, empty string on no expiration time, or undef on $key is not found.

  • my $expires = $kt->head($key);

Check the $key is exists or not.

Return: $expires: RFC 1123 date format of GMT, empty string on no expiration time, or undef if $key not found.

  • $kt->put($key, $val[, $expires]);

Store the $val on the server under the $key. $key should be a scalar. $value should be defined and may be of any Perl data type.

$expires: expiration time. If $expires>0, expiration time in seconds from now. If $expires<0, the epoch time. It is never remove if missing $expires.

Return: 1 if server returns OK(201), or undef in case of some error.

  • $kt->delete($key);

Remove cache data for $key.

Return: 1 if server returns OK(200). 0 if server returns not found(404), or undef in case of some error.

AUTHOR

Tokuhiro Matsuno

SEE ALSO

Cache::KyotoTycoon

LICENSE

Copyright (C) Tokuhiro Matsuno

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

cache-kyototycoon-rest's People

Contributors

tokuhirom avatar

Stargazers

Angus H. avatar Alex Gaziev avatar  avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.