Go Rest API Client
Closed this issue · 3 comments
Since I'm currently building one for myself. I like to check if there already is some REST client for the Chirpstack API in Go?
I guess you focused more on the JS side. At least I'm now using the entities from https://godoc.org/github.com/brocaar/chirpstack-api/go/as/external/api
for implementation.
Once it is a little bit more major I would also consider sharing the code.
Okay it just failed while unmarshaling the JSON response of a device:
type Device struct {
// Device EUI (HEX encoded).
DevEui string `protobuf:"bytes,1,opt,name=dev_eui,json=devEUI,proto3" json:"dev_eui,omitempty"`
devEUI
!= dev_eui
How does this come?
Hi @niondir I don't see any reasons to provide a REST client for Go. The REST interface is a layer on top of the gRPC API so that:
[REST client] -- JSON --> [gRPC Gateway] --> gRPC --> [gRPC API]
Just use the gRPC API that is already there :-) That saves you work in implementing a Go client, but also is more performant as it saves one layer of abstraction (the gRPC Gateway to gRPC API abstraction is embedded in the ChirpStack AS).
As an example you could take a look at https://github.com/brocaar/chirpstack-simulator, which uses the API to create gateways, devices etc..
I avoided to take a deeper look into the gRPC stuff yet ;) But it seems like the best solution, I will have a look.