-
-
23 Jan 2016 09:32:30 UTC
- Distribution: URI-redis
- Module version: 0.02
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Repository
- Issues
- Testers (4607 / 6 / 0)
- Kwalitee
Bus factor: 1- 100.00% Coverage
- License: perl_5
- Activity
24 month- Tools
- Download (30.61KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 1 contributors- Norbert Buchmueller.
- Dependencies
- URI
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
URI::redis - URI for Redis connection info
SYNOPSIS
use URI::redis; $url = URI->new('redis://redis.example.com?password=correcthorsebatterystaple'); $url = URI->new('redis://redis.example.com?db=5&password=correcthorsebatterystaple'); $url = URI->new('redis+unix:///tmp/redis.sock?db=5&password=correcthorsebatterystaple');
DESCRIPTION
The
URI::redis
class supportsURI
objects belonging to the redis and redis+unix URI scheme.Such URLs are used to encode connection info (
redis
: host, port, password, database,redis+unix
: socket path, password, database) to Redis servers.Supported URLs are in any of these formats:
redis://HOST[:PORT][?db=DATABASE[&password=PASSWORD]]
redis://HOST[:PORT][?password=PASSWORD[&db=DATABASE]]
redis://[:PASSWORD@]HOST[:PORT][/DATABASE]
redis://[:PASSWORD@]HOST[:PORT][?db=DATABASE]
redis://HOST[:PORT]/DATABASE[?password=PASSWORD]
-
A TCP connection, see http://www.iana.org/assignments/uri-schemes/prov/redis.
The port defaults to 6379 and the host defaults to "localhost".
redis+unix://[:PASSWORD@]SOCKET_PATH[?db=DATABASE]
redis+unix://SOCKET_PATH[?db=DATABASE[&password=PASSWORD]]
redis+unix://SOCKET_PATH[?password=PASSWORD[&db=DATABASE]]
-
A Unix domain socket connection.
METHODS
In addition to the methods inherited from URI, it provides the following methods:
database
Returns the database number from the path or the
db
query param.Returns 0 if no database is specified.
database_from_path
Returns the database number encoded in the path part of the URI. Only works if the path is in the format
^ / \d+
.Returns undef if no database can be parsed from the path.
database_from_query
Returns the database number from the
db
query param.Returns undef if no
db
query param, or it has no value set.password
Returns the password from the userinfo or the
password
query param.password_from_userinfo
Returns the password part of the "userinfo" in URI.
password_from_query
Returns the password from the
password
query param.socket_path
Returns the Unix domain socket path.
Returns undef if the URI is not of the 'redis+unix' scheme.
SEE ALSO
COPYRIGHT
Copyright 2016 Norbert Buchmueller.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Module Install Instructions
To install URI::redis, copy and paste the appropriate command in to your terminal.
cpanm URI::redis
perl -MCPAN -e shell install URI::redis
For more information on module installation, please visit the detailed CPAN module installation guide.