Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ambientweather

Go client for the Ambientweather service.

GitHub Workflow Status

Usage

  1. Generate an app and API key from your account

  2. Use the API:

package main

import (
	"fmt"
	"log"
	"net/http"

	ambient "github.com/transcelestial/ambientweather"
)

func main() {
	key := ambient.NewKey("appkey", "apikey")

	devices, err := ambient.GetDevice(key)
	if err != nil {
		log.Fatal(err)
	}

	if devices.HTTPResponseCode == http.StatusOK {
		for _, dev := range devices.DeviceRecords {
			fmt.Println(dev)
		}
	}
}

Test

To run tests run:

go test .

To avoid caching during tests use:

go test -count=1 .

To get coverage reports use the -cover flag:

go test -coverprofile=coverage.out .

And to view the profile run:

go tool cover -html=coverage.out

To run static analysis on the code run:

go vet .

Contribute

If you wish to contribute, please use the following guidelines:

Credits/Contributors

About

Go client for the Ambientweather service.

Topics

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Contributors

Languages