This library fully supports Web Thing REST API.You can start building your Web of Thing by looking at single-thing.
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 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
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