Skip to content

dravenk/webthing-go

Repository files navigation

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