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

Make 'decoder' and 'marshal' public #73

Closed
wants to merge 2 commits into from
Closed

Make 'decoder' and 'marshal' public #73

wants to merge 2 commits into from

Conversation

chiaradiamarcelo
Copy link

@chiaradiamarcelo chiaradiamarcelo commented Jun 17, 2020

The purpose of this PR is to make the 'decoder' and 'marshal' public so they can be extended.

A possible use case is extend the 'decoder' to unmarshal server request and make it possible to integrate the library with different servers, for example. For the same use case, making the 'marshal' function public is enough for encoding a server response.

I work for the Uyuni-project (https://github.com/uyuni-project) and in our side, we are integrating this library with Gorilla RPC(https://github.com/gorilla/rpc) to build an API gateway (https://github.com/uyuni-project/hub-xmlrpc-api).

@icholy
Copy link
Collaborator

icholy commented Jun 17, 2020

@chiaradiamarcelo hey thanks for the contribution. Instead of exporting Decoder, wouldn't just exporting Marshal and Unmarshal cover the same use-case?

@chiaradiamarcelo
Copy link
Author

chiaradiamarcelo commented Jun 17, 2020

@chiaradiamarcelo hey thanks for the contribution. Instead of exporting Decoder, wouldn't just exporting Marshal and Unmarshal cover the same use-case?

Hi @icholy , thanks for the reply.

Exporting 'Unmarshal' is not enough, cause it assumes that only one parameter is contained in the raw XML. I guess it's this way cause it's purpose is to unmarshal a server response, and usually it comes all in one field.
For unmarshalling a server request this has to be extended to be able to decode many parameters instead of only one.

@icholy
Copy link
Collaborator

icholy commented Jun 17, 2020

@chiaradiamarcelo I think this change is out of scope for this project. You might want to check out https://github.com/alexejk/go-xmlrpc for another implementation of xmlrpc.

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

Successfully merging this pull request may close these issues.

2 participants