senml

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

README

SenML Message Transformer

SenML Transformer provides Message Transformer for SenML messages. It supports JSON and CBOR content types - To transform Mainflux Message successfully, the payload must be either JSON or CBOR encoded SenML message.

Documentation

Index

Constants

View Source
const (
	// JSON represents SenML in JSON format content type.
	JSON = "application/senml+json"
	// CBOR represents SenML in CBOR format content type.
	CBOR = "application/senml+cbor"
)

Variables

This section is empty.

Functions

func New

func New(contentFormat string) transformers.Transformer

New returns transformer service implementation for SenML messages.

Types

type Message

type Message struct {
	Channel     string   `json:"channel,omitempty"`
	Subtopic    string   `json:"subtopic,omitempty"`
	Publisher   string   `json:"publisher,omitempty"`
	Protocol    string   `json:"protocol,omitempty"`
	Name        string   `json:"name,omitempty"`
	Unit        string   `json:"unit,omitempty"`
	Time        float64  `json:"time,omitempty"`
	UpdateTime  float64  `json:"update_time,omitempty"`
	Value       *float64 `json:"value,omitempty"`
	StringValue *string  `json:"string_value,omitempty"`
	DataValue   *string  `json:"data_value,omitempty"`
	BoolValue   *bool    `json:"bool_value,omitempty"`
	Sum         *float64 `json:"sum,omitempty"`
}

Message represents a resolved (normalized) SenML record.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL