gorilla/rpc

Serve/define RPC methods without namespacing to a class/struct?

daluu opened this issue · 1 comments

daluu commented

Hi,

I'm a novice at go, and looking at XML-RPC server for go and came upon https://github.com/divan/gorilla-xmlrpc which utilizes this package. For my particularly use case, the RPC method names are not "prefixed" with a class/namespace, but rather being global, so just a method name to call. e.g. call "multiply" or "Multiply" instead of "Foo.Multiply".

It's not clear from the documentation / unit tests, e.g.:

  • server_test.go
  • v2/server_test.go

but it seems the tests/examples "require" a class/namespace prefixed to the method when making the RPC call. Is there an option or way to make the RPC call omitting the namespace, more like just use a "global" namespace? I understand namespace is useful/necessary when serving from multiple structs or packages, but in my case, it would be a single one, so there's no ambiguity. And for my use case, the "client" is expecting to make the (XML) RPC call without a namespace, so I don't have leeway to accommodate namespacing in the RPC request.

P.S. the XML-RPC server I intend to build is serving multiple namespaced methods via use of reflection through a single wrapper class. I've done this same thing in other XML-RPC server implementations (for other languages), would like to do for go now.

daluu commented

solved in the referenced issue, closing here as well