Support partial unmarshal of parameters
Support partial unmarshal of parameters

The jsonrpc codec only supports unmarshaling parameters into an
interface{} slice. However, for performance reasons, it might be of
interest to execute a partial unmarshal at any level within the
parameters and delay unmarshaling until a later point in time.

This commit changes ReadRequestBody and WriteRequest to allow
(un)marshaling into any kind of slice so that partial unmarshaling is
supported as well as directly defining the type of slice, if known,
directly in the registered handler.

The following handlers got unmarshal errors from enconding/json before
this change:

func someHandler(client *rpc2.Client, params []json.RawMessage, reply *interface{}) error {}
func someHandler(client *rpc2.Client, params []string, reply *interface{}) error {}

Signed-off-by: Eduardo Ramirez <fd6aa3eaa8498a84bffd3990bbe0405512ad2e55@hpe.com>

cenkalti/rpc2