resin-io/pinejs-client-go

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Pine.js Go Library

This is a simple Go library for interacting with pine.js. Also includes object definitions to interact with the resin.io API.

Usage
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


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.