Rather than adding each API call by hand, it may be easier to automatically generate the bindings from the IDL? This is how all the other bindings are done.
There are (at least) two ways of doing this:
- Integrate directly with the OCaml-based API definitions, as done for the existing bindings in https://github.com/xapi-project/xen-api-sdk.
- Write a generator that reads in the API definitions from a JSON file that is exported from the OCaml-based IDL. This is what the new XenAPI docs on http://xapi-project.github.io/xen-api use (see https://raw.githubusercontent.com/xapi-project/xapi-project.github.io/master/_data/xenapi.json for the JSON file). This way, you can write the generator in any language you like, including golang :)
Rather than adding each API call by hand, it may be easier to automatically generate the bindings from the IDL? This is how all the other bindings are done.
There are (at least) two ways of doing this: