Skip to content

derekpitt/phant

Repository files navigation

phant go client for data.sparkfun.com

quick data poster for http://data.sparkfun.com

post data example

package main

import (
  "github.com/derekpitt/phant"
)

func main() {
  c := phant.Create("<publickey>", "<privatekey>")

  err := c.Post(map[string]string{"derek": "1", "test": "2"})

  if err != nil {
    // dang..
  }
}

get data example

package main

import (
  "fmt"
  "github.com/derekpitt/phant"
)

// define what fields are in the stream here
type testType struct {
  Derek     string
  Test      string
  Timestamp string
}

func main() {
  // declare your data holder to be an array!
  var d []testType

  // don't forget to use your address operator here! (&)
  phant.AllData("RMMW22NWWzh6oj1NyADE", &d)

  fmt.Printf("%#v", d)
}

Docs

https://godoc.org/github.com/derekpitt/phant

TODO:

  1. read X-Rate-Limit- headers
  2. CreateStream method
  3. Clear method
  4. Delete method
  5. Getting Data
  6. Stats

About

Phant data pusher in Go

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages