Name: pinejs-client-go
Owner: Resin.io
Description: A Go client for resin.io's pine.js API
Created: 2015-11-20 16:36:56.0
Updated: 2016-11-13 20:26:39.0
Pushed: 2017-04-12 16:57:25.0
Homepage: null
Size: 67
Language: Go
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This is a simple Go library for interacting with pine.js. Also includes object definitions to interact with the resin.io API.
rt (
pinejs "github.com/resin-io/pinejs-client-go"
"github.com/resin-io/pinejs-client-go/resin"
sing a struct
GetDatDevice() {
var device resin.Device{Id: 1234}
pineClient := pinejs.NewClient("https://api.resinstaging.io/ewa", "secretapikey")
if err := pineClient.Get(&device); err != nil {
log.Fatalln(err)
} else {
// device contains the device object with id 1234.
}
sing a map
GetDatDeviceOnAMap() {
device := map[string]interface{}{"pinejs": "device", "id": 1234}
pineClient := pinejs.NewClient("https://api.resinstaging.io/ewa", "secretapikey")
if err := pineClient.Get(&device); err != nil {
log.Fatalln(err)
} else {
// device contains the device object with id 1234.
}
More examples in test/test.go