NAME
Dancer::RPCPlugin::CallbackResult - Factory for generating Callback-results.
SYNOPSIS
use Dancer::Plugin::RPC::JSONRPC;
use Dancer::RPCPlugin::CallbackResult;
jsonrpc '/admin' => {
publish => 'config',
callback => sub {
my ($request, $rpc_method) = @_;
if ($rpc_method =~ qr/^admin\.\w+$/) {
return callback_success();
}
else {
return callback_fail(
error_code => -32768,
error_message => "only admin methods allowed: $rpc_method",
);
}
},
};
DESCRIPTION
callback_success()
Allows no arguments.
Returns an instantiated Dancer::RPCPlugin::CallbackResult::Success object.
callback_fail(%arguments)
Allows these named arguments:
Returns an instantiated Dancer::RPCPlugin::CallbackResult::Fail object.
PACKAGE
Dancer::RPCPlugin::CallbackResult::Success - Class for success
new()
Constructor, does not allow any arguments.
PACKAGE
Dancer::RPCPlugin::CallbackResult::Fail - Class for failure
new()
Constructor, allows named arguments:
COPYRIGHT
(c) MMXVI - Abe Timmerman <abeltje@cpan.org>