Skip to content

Latest commit

 

History

History
62 lines (44 loc) · 2.65 KB

README.md

File metadata and controls

62 lines (44 loc) · 2.65 KB

Web of Things


GitHub forks GitHub version GoDoc Codacy Badge travis Go Report Card codebeat badge Build Status

USAGE

This library fully supports Web Thing REST API.You can start building your Web of Thing by looking at single-thing.

Download and import

This package name is called webthing. This project is called webthing-go to keep the naming consistent with the implementation of other languages. You just need to import this package the way golang normally imports a package.

go get -u -v github.com/dravenk/webthing-go
import (
 "github.com/dravenk/webthing-go"
)

Create Thing

// Create a Lamp.
thing := webthing.NewThing("urn:dev:ops:my-thing-1234",
 "Lamp",
 []string{"OnOffSwitch", "Light"},
 "A web connected thing")

For more information on Creating Webthing, please check the wiki Create-Thing

Example

cd $GOPATH/src/github.com/dravenk/webthing-go
go run examples/single-thing/single-thing.go

You can also run a sample with docker:

docker run -ti --name single-thing -p 8888:8888 dravenk/webthing

For more information on Run Example, please check the wiki Run-Example

RESOURCES