mirror of
https://github.com/mainflux/mainflux.git
synced 2025-05-01 13:48:56 +08:00
24 lines
807 B
Go
24 lines
807 B
Go
![]() |
// Copyright (c) Mainflux
|
||
|
// SPDX-License-Identifier: Apache-2.0
|
||
|
|
||
|
package json
|
||
|
|
||
|
// Payload represents JSON Message payload.
|
||
|
type Payload map[string]interface{}
|
||
|
|
||
|
// Message represents a JSON messages.
|
||
|
type Message struct {
|
||
|
Channel string `json:"channel,omitempty" db:"channel" bson:"channel"`
|
||
|
Created int64 `json:"created,omitempty" db:"created" bson:"created"`
|
||
|
Subtopic string `json:"subtopic,omitempty" db:"subtopic" bson:"subtopic,omitempty"`
|
||
|
Publisher string `json:"publisher,omitempty" db:"publisher" bson:"publisher"`
|
||
|
Protocol string `json:"protocol,omitempty" db:"protocol" bson:"protocol"`
|
||
|
Payload Payload `json:"payload,omitempty" db:"payload" bson:"payload,omitempty"`
|
||
|
}
|
||
|
|
||
|
// Messages represents a list of JSON messages.
|
||
|
type Messages struct {
|
||
|
Data []Message
|
||
|
Format string
|
||
|
}
|