gRPC APIs (client libs in 9+ languages) - Roon extension

(Sam Bosley) #1

Hello fellow Roon tinkerers,
In playing with the Roon API, I found that I was often getting slowed down due to working in Node.js. Not to knock Node; it’s just very unfamiliar to me and JavaScript has never been my favorite. I also noticed that several other folks on the forums have expressed interest in client libraries in other languages.

I wrote this small extension to be a solution for those like me who just want to tinker with the Roon API from some other language/platform, while still using a client library that feels native to that language. Introducing the Roon API gRPC bridge:

This extension acts as a wrapper around RoonBrowseApi, RoonImageApi, and RoonTransportApi. It includes a structured protocol buffer service definition, which contains a roughly 1-1 mapping of RPC methods to the Roon API Node.js client methods. Running the extension exposes a locally running server paired to a Roon core that can be called using any gRPC client. The gRPC protobuf compilers will generate idiomatic client libraries for the service in any of the supported gRPC languages, which include but are not limited to C++, Java, Python, Go, Ruby, and C# – so all you have to do is generate the client library in your preferred language from the protobuf definition, and you can call the Roon API using that client library.

More details + links to documentation about gRPC and protobuf can be found in the project README. I’ve also included a small example of generating a client library in Go and calling a few API methods using the generated library.

There are parts of the API surface that I haven’t tested extensively yet, but I’ve had success thus far in calling the Roon API from other languages. If you decide to try it out and discover problems, please feel free to report issues!

(Bob Cleveland) #2

Bazel and gRpc. How Googley. :wink: