Data-CouchDB

 view release on metacpan or  search on metacpan

lib/Data/CouchDB/Connection.pm  view on Meta::CPAN

package Data::CouchDB::Connection;

use 5.006;
use strict;
use warnings;

our $VERSION = '0.14';

=head1 NAME

Data::CouchDB - CouchDB document management

=cut

=head1 NAME

Data::CouchDB::Connection

=head1 SYNOPSYS

    my $couch_connection = Data::CouchDB::Connection->new(
        host   => 'localhost',
        port   => 5432,
        protocol => 'http://',
        couch => 'testdb',
    );

=head1 DESCRIPTION

This class represents a couchdb connection.

=head1 ATTRIBUTES

=cut

use Moose;
use MooseX::StrictConstructor;
use namespace::autoclean;

use CouchDB::Client;
use Net::SSL;
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Headers;
use Try::Tiny;
use IO::Socket::SSL qw( SSL_VERIFY_NONE );
use Data::CouchDB::Exceptions;

=head2 host

name of the host to connect to.

=cut

has 'host' => (
    is       => 'ro',
    isa      => 'Str',
    required => 1,
);

=head2 port

name of the port to connect to.

=cut

has 'port' => (
    is       => 'ro',
    isa      => 'Str',
    required => 1,
);

=head2 db

db with which to operate.

=cut

has db => (
    is      => 'ro',
    isa     => 'Str',
    default => 'db',
);

=head2 protocol

protcol with which to connect.

Can be,
    'http://' or 'https://'

=cut

has 'protocol' => (
    is         => 'ro',
    isa        => 'Str',
    lazy_build => 1,
);

=head2 couchdb

password for "couchdb" user

=cut

has 'couchdb' => (



( run in 1.555 second using v1.01-cache-2.11-cpan-39bf76dae61 )