Why not adopt me?
NAME
Net::FluidDB - A Perl interface to FluidDB
SYNOPSIS
use Net::FluidDB;
# predefined FluidDB client for playing around, points
# to the sandbox with user test/test
$fdb = Net::FluidDB->new_for_testing;
$fdb = Net::FluidDB->new_for_testing(trace_http => 1);
# FluidDB client pointing to production
$fdb = Net::FluidDB->new(username => 'username', password => 'password');
# FluidDB taking credentials from environment variables
# FLUIDDB_USERNAME and FLUIDDB_PASSWORD
$fdb = Net::FluidDB->new;
DESCRIPTION
Net::FluidDB provides an interface to the FluidDB API.
The documentation of Net::FluidDB does not explain FluidDB, though there are links to relevant pages in the documentation of each class.
If you want to get familiar with FluidDB please check these pages:
- FluidDB high-level description
- FluidDB API documentation
- FluidDB API specification
- FluidDB Essence blog posts
BETA VERSION
Net::FluidDB is in beta stage. A beta in terms of interface mostly, the entire API is implemented except for tag values (see below). The module has good test coverage (~1700 tests in the full suite), and is well-documented.
It is a beta because:
The overall interface is taking shape. I consider the basis to be there, but I may still fine-tune some detail. I may still do backward-incompatible modifications, though I don't expect them to be anything but minor at this point.
In particular, since FluidDB is new usage patterns have yet to arise. They may influence the design of the interface.
Tagging with anything but a native FluidDB type is unsupported. The very API in FluidDB is gonna be revised soon on this point so I am waiting.
As of this version calls to FluidDB return a status flag. If there was any failure the module only prints the response to STDERR and returns false.
Forthcoming versions will address those points.
Class Methods
- Net::FluidDB->new(%attrs)
-
Returns an object for communicating with FluidDB.
This is a wrapper around LWP::UserAgent and does not validate credentials in the very constructor. If they are wrong requests will fail when performed.
Attributes and options are:
- username
-
Your username in FluidDB. If not present uses the value of the environment variable FLUIDDB_USERNAME.
- password
-
Your password in FluidDB. If not present uses the value of the environment variable FLUIDDB_PASSWORD.
- protocol
-
Either 'HTTP' or 'HTTPS'. Defaults to 'HTTP'.
- host
-
The FluidDB host. Defaults to fluiddb.fluidinfo.com.
- trace_http_requests
-
A flag, logs all HTTP requests if true.
- trace_http_responses
-
A flag, logs all HTTP responses if true.
- trace_http
-
A flag, logs all HTTP requests and responses if true. (Shorthand for enabling the two above.)
- Net::FluidDB->new_for_testing
-
Returns a
Net::FluidDB
instance pointing to the sandbox with "test"/"test". The host of the sandbox can be checked in the package variable$Net::FluidDB::SANDBOX_HOST
.
Instance Methods
- $fdb->username
- $fdb->username($username)
-
Gets/sets the username.
- $fdb->password
- $fdb->password($password)
-
Gets/sets the password.
- $fdb->protocol
- $fdb->protocol($protocol)
-
Gets/sets the protocol, either 'HTTP' or 'HTTPS'.
- $fdb->ua
-
Returns the instance of LWP::UserAgent used to communicate with FluidDB.
- $fdb->user
-
Returns the user on behalf of whom fdb is doing calls. This attribute is lazy loaded.
AUTHOR
Xavier Noria (FXN), <fxn@cpan.org>
COPYRIGHT AND LICENSE
Copyright (C) 2009 Xavier Noria
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 185:
You forgot a '=back' before '=head1'