mirror of
https://github.com/mainflux/mainflux.git
synced 2025-05-04 22:17:59 +08:00

* Add Transformer tests Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Fix readers and writers Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Fix README typo Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Tidy vendor Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Remove link field from docs Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
27 lines
928 B
Go
27 lines
928 B
Go
package senml
|
|
|
|
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"
|
|
)
|
|
|
|
// Message represents a resolved (normalized) SenML record.
|
|
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"`
|
|
}
|