Group
Extension

Matches 1

Sledge-Plugin-JSONRPC ( N/NE/NEKOKAK/Sledge-Plugin-JSONRPC-0.01.tar.gz, NEKOKAK, 2006; MetaCPAN )
Sledge-Plugin-JSONRPC/lib/Sledge/Plugin/JSONRPC.pm ( view source; MetaCPAN )
package Sledge::Plugin::JSONRPC;
use strict;
use warnings;
use JSON::Syck;

our $VERSION = '0.01';

sub import {
    my $self = shift;
    my $pkg  = caller;

    $pkg->register_hook(BEFORE_INIT => su
o strict 'refs';
    *{"$pkg\::jsonrpc"} = \&_jsonrpc;
}

sub _jsonrpc {
    my $self = shift;

    my $req;
    # Deserialize request
    eval { $req = _deserialize_jsonrpc($self) };
    if ($@ || !$
req) {
        warn qq{Invalid JSONRPC request "$@"};
        _serialize_jsonrpc($self,{
            result => undef,
            eror   => 'Invalid request'
        });
        return 0;
    }

    m

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.