GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  DANCER::PLUGIN::REDIS (3)

.ds Aq ’

NAME

Dancer::Plugin::Redis - easy database connections for Dancer applications

CONTENTS

VERSION

version 0.8

DESCRIPTION

Provides an easy way to obtain a connected Redis database handle by simply calling the redis keyword within your Dancer application.

SYNOPSIS



    use Dancer;
    use Dancer::Plugin::Redis;

    # Calling the redis keyword will get you a connected Redis Database handle:
    get /widget/view/:id => sub {
        template display_widget, { widget => redis->get(hash_key); };
    };

    dance;



Redis connection details are read from your Dancer application config - see below.

METHODS

    redis

Keywords redis, that use your config to connect to redis

CONFIGURATION

Connection details will be taken from your Dancer application config file, and should be specified as, for example:



    plugins:
        Redis:
            server: 127.0.0.1:6379
            debug: 0
            encoding: utf8
            reconnect: 60
            password: yourpassword
            connections:
                test:
                    server: 127.0.0.1:6380
                    debug: 1
                    encoding: utf8
                    password: yourpassword



server is the ip:port of redis server

debug activate the debug of redis

encoding activate auto encoding, if you want raw data, put nothing after encoding

reconnect is the number of second which try to reconnect if we have lost connection, default to 60

password pass AUTH to Redis if you use the requirepass config. You can skip this option if you don’t have requirepass set.

GETTING A DATABASE HANDLE

Calling redis will return a connected database handle; the first time it is called, the plugin will establish a connection to the database, and return a reference to the DBI object. On subsequent calls, the same DBI connection object will be returned. The connection will be refresh automatically with the Redis reconnect option.

If you have declared named connections as described above in ’DEFINING MULTIPLE CONNECTIONS’, then calling the database() keyword with the name of the connection as specified in the config file will get you a database handle connected with those details.

SEE ALSO

Dancer

DBI

Redis

BUGS

Please report any bugs or feature requests on the bugtracker website https://github.com/celogeek/Dancer-Plugin-Redis/issues

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

AUTHOR

celogeek <me@celogeek.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by celogeek <me@celogeek.com>.

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

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 DANCER::PLUGIN::REDIS (3) 2016-04-03

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.