Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for method name mapping #8

Open
tdterry opened this issue Jun 6, 2016 · 5 comments
Open

Support for method name mapping #8

tdterry opened this issue Jun 6, 2016 · 5 comments

Comments

@tdterry
Copy link

tdterry commented Jun 6, 2016

I'm converting a legacy system from Python into Go, and I have some restrictions on the method names that don't work with Go's RPC layer and rpc-codec. The legacy method names are all lowercase and do not have a namespace structure "namespace.method". rpc-codec works great for me with a small hack to add "default." and capitalize the first letter of the method name. Is there an interest in making this part of rpc-codec. If desired, I could change this to a more generic "method transform" callback.

see:

tdterry@a61f131

@powerman
Copy link
Owner

This should be implemented in net/rpc, otherwise we'll have to implement this in each codec… Can you please ask Go developers about adding this feature into net/rpc? If they're willing to do this, in any way, then it's better to send PR to net/rpc. If they'll refuse to add this feature - then I'll accept PR with generic method transform callback.

@tdterry
Copy link
Author

tdterry commented Jul 20, 2016

Thanks. I've submitted golang/go#16449. We'll see if there is any interest.

@dryswabbie
Copy link

Looks like net/rpc has been frozen due to problems, and they are recommending alternatives such as http://www.grpc.io/

golang/go#16844

@libreoscar
Copy link

@powerman Given that net/rpc has been frozen, are you open to add this feature in powerman/rpc-codec? It makes migrating from other JSON-RPC implementation to this repo a lot easier.

@powerman
Copy link
Owner

@libreoscar Given that net/rpc has been frozen, I think better solution should be to reimplement JSON RPC 2.0 as new package which doesn't depend on net/rpc. This helps to avoid several ugly workarounds required because of net/rpc and enable new features like method name mapping. But meanwhile we can add this feature here if anyone will send me good enough PR with tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants