OK...
I'm able to generate Golang package from the json you gave. But I will need some help to understand some subtilities.
First, to clarify the subject (in case of you're not a Golang developper) you need to know that:
- Go has no class, we've got "struct" that can handle properties and functions (that's not very different)
- Go has no abstract class
- Go has interfaces, so I've got possibilities to create right interfaces.
Each element I parse from json description is generated as "type".
The problem arrives when I see a the "abstract" property. Because I cannot create such class (struct) I let them instanciable.
First questions
Let me show you what will be possible:
// create a MediaPipeline
pipeline := &MediaPipeline{}
// prepare a webrtc endpoint
webrtc := &WebRtcEndpoint{}
pipeline.create(webrtc)
// -> with reflection, I know that I will call "create" on API with type "WebRtcEndoint"
So, now, it's ok. "webrtc" object is a WebRtcEnpoint (go type, struct)
What makes me disapointed is that I know that to create a WebRtcEndpoint, I need to "connect" the sink. If I'm not wrong, javascript-client knows that and do the job. But where is it described ?
Or maybe, each "create" method should connect parent to created sink ?
If someone can help me to be sure I'm not making something wrong...
Second questions:
Each API call need to have an "id" (client id). If I don't change this id each time, API doesn't respond with correct values. Is it mandatory to change this id for each call ? or one more time I did something wrong ?...
PS: Sorry for my bad english