Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 3 months 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 (11 months ago)
- Last Synced: 2024-10-31T18:38:26.313Z (3 months 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: 2
- 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
---
[![GitHub forks](https://img.shields.io/github/forks/dravenk/webthing-go.svg?style=social&label=Fork&maxAge=2592000)](https://GitHub.com/dravenk/webthing-go/network/)
[![GitHub version](https://badge.fury.io/gh/dravenk%2Fwebthing-go.svg)](https://badge.fury.io/gh/dravenk%2Fwebthing-go)
[![GoDoc](https://godoc.org/github.com/dravenk/webthing-go?status.png)](https://godoc.org/github.com/dravenk/webthing-go)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/bef38274a3cb4156b374bb76dc1670e5)](https://www.codacy.com/manual/dravenk/webthing-go?utm_source=github.com&utm_medium=referral&utm_content=dravenk/webthing-go&utm_campaign=Badge_Grade)
[![travis](https://api.travis-ci.com/dravenk/webthing-go.svg)](https://api.travis-ci.com/dravenk/webthing-go.svg)
[![Go Report Card](https://goreportcard.com/badge/github.com/dravenk/webthing-go)](https://goreportcard.com/report/github.com/dravenk/webthing-go)
[![codebeat badge](https://codebeat.co/badges/090b9189-b20c-4910-8ff2-d7c12a28e55f)](https://codebeat.co/projects/github-com-dravenk-webthing-go-master)
[![Build Status](https://img.shields.io/docker/cloud/build/dravenk/webthing.svg)](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
*
*