-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
Milestone
Description
I'm converting a legacy system that uses json-rpc into Go, and I have some restrictions on the method names that don't work with Go's RPC layer. The legacy method names are all lowercase and do not have a namespace structure "method_name". Go's RPC layer wants to use "Class.Method" as the method name. It would be very useful to be able to either a) provide a mapping of method names when registering a handler or b) register individual methods with a custom name.
Something like this, as taken from the net/rpc package example:
arith := new(Arith)
rpc.RegisterWithNames(arith, map[string]string{
"mul": "Arith.Multiply",
"div": "Arith.Divide",
})
// or
rpc.RegisterMethod("mul", Arith.Multiply)
rpc.RegisterMethod("div", Arith.Divide)
mem, gavbaa, OrangeTux, tscholl2, muety and 1 more