Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
Dancer::RPCPlugin::CalUserkContributed PerDancer::RPCPlugin::CallbackResult(3)

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:

       error_code => $code
       error_message =>	$message

       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:

       error_code => $code
       error_message =>	$message

COPYRIGHT
       (c) MMXVI - Abe Timmerman <abeltje@cpan.org>

perl v5.24.1			  2016-02-Dancer::RPCPlugin::CallbackResult(3)

NAME | SYNOPSIS | DESCRIPTION | PACKAGE | PACKAGE | COPYRIGHT

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=Dancer::RPCPlugin::CallbackResult&sektion=3&manpath=FreeBSD+12.1-RELEASE+and+Ports>

home | help