/particle

golang utilities for particle.io stuff

Primary LanguageGoMIT LicenseMIT

particle

-- import "github.com/mckee/particle"

Usage

const URL string = "https://api.particle.io/v1/devices/events/"

func Subscribe

func Subscribe(eventPrefix string, token string) <-chan Event

subscribes to a particle.io event stream and returns a channel to receive them

type Event

type Event struct {
	Name string
	Data struct {
		Data      string `json:"data"`
		TTL       string `json:"ttl"`
		Timestamp string `json:"published_at"`
		CoreID    string `json:"coreid"`
	}
}