func (h *Handler) Handle(ctx context.Context, conn *jsonrpc2.Conn, req *jsonrpc2.Request) {
	jsonrpc2.HandlerWithError(h.handle).Handle(ctx, conn, req)
}
Handle implements jsonrpc2.Handler.
package jsonrpc
import (
	"context"
	"fmt"
	"reflect"
	"github.com/sourcegraph/jsonrpc2"
)
var (
	defaultHandler = NewHandler()
)
type HandlerFunc func(context.Context, *jsonrpc2.Conn, *jsonrpc2.Request) (interface{}, error)
func RegisterMethod(method string, handlerFunc HandlerFunc, paramsType interface{}) {
	defaultHandler.RegisterMethod(method, handlerFunc, paramsType)
}
type Handler struct {
	methods map[string]HandlerFunc
}
func NewHandler() *Handler {
	return &Handler{
		methods: make(map[string]HandlerFunc),
	}
}
func (h *Handler) RegisterMethod(method string, handlerFunc HandlerFunc, paramsType interface{}) {
	if _, ok := h.methods[method]; ok {
		panic(fmt.Sprintf("method %q already registered", method))
	}
	if paramsType == nil {
		h.methods[method] = handlerFunc
		return
	}
	typ := reflect.TypeOf(paramsType)
	if typ.Kind() == reflect.Ptr {
		typ = typ.Elem()
	}
	h.methods[method] = processParams(handlerFunc, typ)
}