https://github.com/dravenk/webthing-go
Go implementation of a Web Thing server
https://github.com/dravenk/webthing-go
go golang iot mozilla-iot rest-api web-of-things websocket-api webthing wot
Last synced: 11 days ago
JSON representation
Go implementation of a Web Thing server
- Host: GitHub
- URL: https://github.com/dravenk/webthing-go
- Owner: dravenk
- License: mpl-2.0
- Created: 2019-09-15T18:48:54.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-03-25T11:15:17.000Z (about 1 year ago)
- Last Synced: 2025-04-12T12:12:43.549Z (11 days ago)
- Topics: go, golang, iot, mozilla-iot, rest-api, web-of-things, websocket-api, webthing, wot
- Language: Go
- Homepage: https://webthings.io/
- Size: 120 KB
- Stars: 22
- Watchers: 1
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-web-of-things - Go - by dravenk (Section / Libraries)
- awesome-ccamel - dravenk/webthing-go - Go implementation of a Web Thing server (Go)
README
# Web of Things
---
[](https://GitHub.com/dravenk/webthing-go/network/)
[](https://badge.fury.io/gh/dravenk%2Fwebthing-go)
[](https://godoc.org/github.com/dravenk/webthing-go)
[](https://www.codacy.com/manual/dravenk/webthing-go?utm_source=github.com&utm_medium=referral&utm_content=dravenk/webthing-go&utm_campaign=Badge_Grade)
[](https://api.travis-ci.com/dravenk/webthing-go.svg)
[](https://goreportcard.com/report/github.com/dravenk/webthing-go)
[](https://codebeat.co/projects/github-com-dravenk-webthing-go-master)
[](https://cloud.docker.com/repository/docker/dravenk/webthing/builds)## USAGE
This library fully supports [Web Thing REST API](https://webthings.io/api/#web-thing-rest-api).You can start building your Web of Thing by looking at [single-thing](https://github.com/dravenk/webthing-go/blob/master/examples/single-thing/single-thing.go).
### 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.
```shell
go get -u -v github.com/dravenk/webthing-go
``````go
import (
"github.com/dravenk/webthing-go"
)
```#### Create Thing
```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](https://github.com/dravenk/webthing-go/wiki/Create-Thing)
#### Example
```shell
cd $GOPATH/src/github.com/dravenk/webthing-go
go run examples/single-thing/single-thing.go
```You can also run a sample with [docker](https://hub.docker.com/r/dravenk/webthing):
```shell
docker run -ti --name single-thing -p 8888:8888 dravenk/webthing
```For more information on Run Example, please check the wiki [Run-Example](https://github.com/dravenk/webthing-go/wiki/Run-example)
RESOURCES
*
*