|
NAMEDancer::Plugin::RPC - Configure endpoints for XMLRPC, JSONRPC and RESTRPC proceduresDESCRIPTIONThis module contains plugins for Dancer: Dancer::Plugin::RPC::XMLRPC, Dancer::Plugin::RPC::JSONRPC and Dancer::Plugin::RPC::RESTRPC.Dancer::Plugin::RPC::XMLRPCThis plugin exposes the new keyword "xmlrpc" that is followed by 2 arguments: the endpoint and the arguments to configure the xmlrpc-calls at this endpoint.Dancer::Plugin::RPC::JSONRPCThis plugin exposes the new keyword "jsonrpc" that is followed by 2 arguments: the endpoint and the arguments to configure the jsonrpc-calls at this endpoint.Dancer::Plugin::RPC::RESTRPCThis plugin exposes the new keyword "restrpc" that is followed by 2 arguments: the endpoint and the arguments to configure the restrpc-calls at this endpoint.General arguments to xmlrpc/jsonrpc/restrpcThe dispatch table is build by endpoint.publish => <config|pod|$coderef>
arguments => $list This argumument is needed for publishing type pod and must be a list of module names that contain the pod (and code). callback => $coderef The callback argument may contain a $coderef that does additional checks and should return a Dancer::RPCPlugin::CallbackResult object. $callback->($request, $method_name, @method_args); Returns for success: "callback_success()" Returns for failure: "callback_fail(error_code => $code, error_message => $msg)" This is useful for eg ACL checking. In the scope of the callback-function you will have the variable $Dancer::RPCPlugin::ROUTE_INFO, a hashref: local $Dancer::RPCPlugin::ROUTE_INFO = { plugin => PLUGIN_NAME, endpoint => $endpoint, rpc_method => $method_name, full_path => request->path, http_method => $http_method, }; Other plugins may want to put extra information in there to help you decide if this request should even be honoured. code_wrapper => $coderef The code_wrapper argument can be used to wrap the code (from the dispatch table). my $wrapper = sub { my $code = shift; my $pkg = shift; my $method = shift; my $instance = $pkg->new(); $instance->$code(@_); }; LICENSEThis library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.See:
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. COPYRIGHT(c) MMXVI - Abe Timmerman <abeltje@cpan.org>
Visit the GSP FreeBSD Man Page Interface. |