ArangoDB2

 view release on metacpan or  search on metacpan

META.json  view on Meta::CPAN

         }
      },
      "configure" : {
         "requires" : {
            "ExtUtils::MakeMaker" : "0"
         }
      },
      "runtime" : {
         "requires" : {
            "Data::Dumper" : "0",
            "JSON::XS" : "0",
            "LWP::UserAgent" : "0",
            "Scalar::Util" : "0",
            "perl" : "5.006"
         }
      }
   },
   "release_status" : "stable",
   "version" : "0.11"
}

META.yml  view on Meta::CPAN

meta-spec:
  url: http://module-build.sourceforge.net/META-spec-v1.4.html
  version: 1.4
name: ArangoDB2
no_index:
  directory:
    - t
    - inc
requires:
  Data::Dumper: 0
  JSON::XS: 0
  LWP::UserAgent: 0
  Scalar::Util: 0
  perl: 5.006
version: 0.11

Makefile.PL  view on Meta::CPAN

    MIN_PERL_VERSION => 5.006,
    CONFIGURE_REQUIRES => {
        'ExtUtils::MakeMaker' => 0,
    },
    BUILD_REQUIRES => {
        'Test::More' => 0,
    },
    PREREQ_PM => {
        'Data::Dumper'      => 0,
        'LWP::UserAgent'    => 0,
        'JSON::XS'          => 0,
        'Scalar::Util'      => 0,
    },
    dist  => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
    clean => { FILES => 'ArangoDB2-*' },
);

lib/ArangoDB2/Admin.pm  view on Meta::CPAN

package ArangoDB2::Admin;

use strict;
use warnings;

use base qw(
    ArangoDB2::Base
);

use JSON::XS;

my $JSON = JSON::XS->new->utf8;



###############
# API METHODS #
###############

# echo
#
# GET /_admin/echo

lib/ArangoDB2/Base.pm  view on Meta::CPAN

package ArangoDB2::Base;

use strict;
use warnings;

use Carp qw(croak);
use Data::Dumper;
use JSON::XS;
use Scalar::Util qw(blessed weaken);



# new
#
# Arango organizes data hierarchically: Databases > Collections > Documents
#
# This constructor can build ArangoDB2::Database, Collection, Document, Edge,
# etc. objects which all follow the same pattern

lib/ArangoDB2/Base.pm  view on Meta::CPAN

#
# either get value  or set JSON bool value.
# setting value returns self.
sub _get_set_bool
{
    my($self, $param, $value, $validate) = @_;

    if (defined $value) {
        # accept "true" as JSON bool false
        if ($value eq "true") {
            $value = JSON::XS::true;
        }
        # accept "false" as JSON bool false
        elsif ($value eq "false") {
            $value = JSON::XS::false;
        }
        # use the true/false of value to determine JSON bool
        else {
            $value = $value ? JSON::XS::true : JSON::XS::false;
        }
        # if we are only validating then return valid value
        return $value if $validate;
        # set value and return self
        $self->{$param} = $value;
        return $self;
    }
    else {
        # return currently set value
        return $self->{$param};

lib/ArangoDB2/Collection.pm  view on Meta::CPAN

package ArangoDB2::Collection;

use strict;
use warnings;

use base qw(
    ArangoDB2::Base
);

use Data::Dumper;
use JSON::XS;

use ArangoDB2::Document;
use ArangoDB2::Edge;
use ArangoDB2::Index;

my $JSON = JSON::XS->new->utf8;

# params that can be set when creating collection
my @PARAMS = qw(
    doCompact isSystem isVolatile journalSize keyOptions name
    numberOfShards shardKeys type waitForSync
);



# checksum

lib/ArangoDB2/Database.pm  view on Meta::CPAN

package ArangoDB2::Database;

use strict;
use warnings;

use base qw(
    ArangoDB2::Base
);

use Data::Dumper;
use JSON::XS;
use Scalar::Util qw(reftype);

use ArangoDB2::Collection;
use ArangoDB2::Graph;
use ArangoDB2::Query;
use ArangoDB2::Replication;
use ArangoDB2::Transaction;
use ArangoDB2::User;

my $JSON = JSON::XS->new->utf8;



# collection
#
# get/create ArangoDB2::Collection object
sub collection
{
    my($self, $name) = @_;

lib/ArangoDB2/Document.pm  view on Meta::CPAN

package ArangoDB2::Document;

use strict;
use warnings;

use base qw(
    ArangoDB2::Base
);

use Data::Dumper;
use JSON::XS;

my $JSON = JSON::XS->new->utf8;



# create
#
# POST /_api/document
#
# Query Parameters
#
# collection: The collection name.

lib/ArangoDB2/Endpoint.pm  view on Meta::CPAN

package ArangoDB2::Endpoint;

use strict;
use warnings;

use base qw(
    ArangoDB2::Base
);

use Data::Dumper;
use JSON::XS;
use URI::Escape qw(uri_escape);

my $JSON = JSON::XS->new->utf8;



###############
# API METHODS #
###############

# create
#
# POST /_api/endpoint

lib/ArangoDB2/Graph.pm  view on Meta::CPAN

package ArangoDB2::Graph;

use strict;
use warnings;

use base qw(
    ArangoDB2::Base
);

use Data::Dumper;
use JSON::XS;

use ArangoDB2::Graph::EdgeDefinition;
use ArangoDB2::Graph::VertexCollection;
use ArangoDB2::Traversal;

my $JSON = JSON::XS->new->utf8;



# create
#
# POST /_api/gharial
sub create
{
    my($self, $args) = @_;
    # process request args

lib/ArangoDB2/Graph/Edge.pm  view on Meta::CPAN

package ArangoDB2::Graph::Edge;

use strict;
use warnings;

use base qw(
    ArangoDB2::Graph::Vertex
);

use Data::Dumper;
use JSON::XS;

my $JSON = JSON::XS->new->utf8;


# POST /_api/gharial/graph-name/edge/collection-name
sub create
{
    my($self, $data, $args) = @_;
    # require data
    die "Invlalid args"
        unless ref $data eq 'HASH';
    # process args

lib/ArangoDB2/Graph/EdgeDefinition.pm  view on Meta::CPAN

package ArangoDB2::Graph::EdgeDefinition;

use strict;
use warnings;

use base qw(
    ArangoDB2::Base
);

use Data::Dumper;
use JSON::XS;

use ArangoDB2::Graph::Edge;

my $JSON = JSON::XS->new->utf8;



# create
#
# POST /_api/gharial/graph-name/edge
sub create
{
    my($self, $args) = @_;
    # process request args

lib/ArangoDB2/Graph/Vertex.pm  view on Meta::CPAN

package ArangoDB2::Graph::Vertex;

use strict;
use warnings;

use base qw(
    ArangoDB2::Base
);

use Data::Dumper;
use JSON::XS;

my $JSON = JSON::XS->new->utf8;



# create
#
# POST /_api/gharial/graph-name/vertex/collection-name
sub create
{
    my($self, $data, $args) = @_;
    # require data

lib/ArangoDB2/Graph/VertexCollection.pm  view on Meta::CPAN

package ArangoDB2::Graph::VertexCollection;

use strict;
use warnings;

use base qw(
    ArangoDB2::Base
);

use Data::Dumper;
use JSON::XS;

use ArangoDB2::Graph::Vertex;

my $JSON = JSON::XS->new->utf8;



# create
#
# POST /_api/gharial/graph-name/vertex
sub create
{
    my($self, $args) = @_;
    # process request args

lib/ArangoDB2/HTTP/Curl.pm  view on Meta::CPAN


use strict;
use warnings;

use base qw(
    ArangoDB2::HTTP
);

use Data::Dumper;
use HTTP::Response;
use JSON::XS;
use Scalar::Util qw(weaken);
use WWW::Curl::Easy;



my $JSON = JSON::XS->new->utf8;



sub new
{
    my($class, $arango) = @_;

    # we do not want to hold this reference if the
    # parent goes out of scope
    weaken $arango;

lib/ArangoDB2/HTTP/LWP.pm  view on Meta::CPAN

package ArangoDB2::HTTP::LWP;

use strict;
use warnings;

use base qw(
    ArangoDB2::HTTP
);

use Data::Dumper;
use JSON::XS;
use LWP::UserAgent;
use Scalar::Util qw(weaken);



my $JSON = JSON::XS->new->utf8;



sub new
{
    my($class, $arango) = @_;
    # we do not want to hold this reference if the
    # parent goes out of scope
    weaken $arango;
    # create new instance

lib/ArangoDB2/Index.pm  view on Meta::CPAN

package ArangoDB2::Index;

use strict;
use warnings;

use base qw(
    ArangoDB2::Base
);

use Data::Dumper;
use JSON::XS;

# parameters that can be set when creating index or
# are returned when creating/getting index
our @PARAMS = qw(
    byteSize constraint fields geoJson id ignoreNull
    isNewlyCreated minLength size type unique
);

my $JSON = JSON::XS->new->utf8;



# byteSize
#
# get/set byteSize
sub byteSize { shift->_get_set('byteSize', @_) }

# constraint
#

lib/ArangoDB2/Query.pm  view on Meta::CPAN

package ArangoDB2::Query;

use strict;
use warnings;

use base qw(
    ArangoDB2::Base
);

use Data::Dumper;
use JSON::XS;

use ArangoDB2::Cursor;

my $JSON = JSON::XS->new->utf8;



# new
#
# create new instance
sub new
{
    my($class, $arango, $database, $query) = @_;

lib/ArangoDB2/Replication.pm  view on Meta::CPAN

package ArangoDB2::Replication;

use strict;
use warnings;

use base qw(
    ArangoDB2::Base
);

use Data::Dumper;
use JSON::XS;

my $JSON = JSON::XS->new->utf8;



###############
# API METHODS #
###############

# applierConfig
#
# GET /_api/replication/applier-config

lib/ArangoDB2/Transaction.pm  view on Meta::CPAN

package ArangoDB2::Transaction;

use strict;
use warnings;

use base qw(
    ArangoDB2::Base
);

use Data::Dumper;
use JSON::XS;

my $JSON = JSON::XS->new->utf8;



# action
#
# get/set action
sub action { shift->_get_set('action', @_) }

# collections
#

lib/ArangoDB2/Traversal.pm  view on Meta::CPAN

package ArangoDB2::Traversal;

use strict;
use warnings;

use base qw(
    ArangoDB2::Base
);

use Data::Dumper;
use JSON::XS;

my $JSON = JSON::XS->new->utf8;

my @PARAMS = qw(
    direction edgeCollection expander filter graphName init itemOrder maxDepth
    maxIterations minDepth order sort startVertex strategy uniqueness visitor
);

# direction
#
# get/ set direction
sub direction { shift->_get_set('direction', @_) }

lib/ArangoDB2/User.pm  view on Meta::CPAN

package ArangoDB2::User;

use strict;
use warnings;

use base qw(
    ArangoDB2::Base
);

use Data::Dumper;
use JSON::XS;

my $JSON = JSON::XS->new->utf8;

my @PARAMS = qw(
    active changePassword extra name passwd
);



###############
# API METHODS #
###############



( run in 0.836 second using v1.01-cache-2.11-cpan-05444aca049 )