https://github.com/objenious/senml
SenML (Sensor Measurement Lists) format for Go
https://github.com/objenious/senml
golang iot senml
Last synced: 5 months ago
JSON representation
SenML (Sensor Measurement Lists) format for Go
- Host: GitHub
- URL: https://github.com/objenious/senml
- Owner: objenious
- License: mit
- Created: 2018-06-29T13:03:29.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-09-11T11:59:43.000Z (almost 7 years ago)
- Last Synced: 2024-10-14T09:19:00.558Z (over 1 year ago)
- Topics: golang, iot, senml
- Language: Go
- Homepage:
- Size: 16.6 KB
- Stars: 13
- Watchers: 1
- Forks: 4
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# senml
[](https://travis-ci.org/objenious/senml) [](http://godoc.org/github.com/objenious/senml)
[](https://goreportcard.com/report/github.com/objenious/senml)
[](https://coveralls.io/github/objenious/senml?branch=master)
`go get github.com/objenious/senml`
## Status: stable
This package implements the SenML format (Sensor Measurement Lists, formerly known as Sensor Markup Language), as defined in [RFC8428](https://tools.ietf.org/html/rfc8428).
This package is used in production on the Objenious LoRaWAN platform, and is maintained.
> Warning: a breaking change was introduced in version 1.0.0, with the Record.Version being renamed to Record.BaseVersion.
## Encoding/decoding
Encoding to/from JSON and XML is managed by the standard library.
```
s := senml.Pack{{Name:"foo", Value: senml.Float(32)}}
err := json.NewEncoder(w).Encode(s)
```
```
s := senml.Pack{}
err := json.NewDecoder(req.Body).Decode(&s)
```
## TODO
* CBOR Representation
* EXI Representation
* Fragment Identification
## Contribution guidelines
Contributions are welcome, as long as :
* unit tests & comments are included,
* no external package is added to the top-level package (but allowed in sub-packages).
## Licence
MIT - See LICENSE