1
0
mirror of https://github.com/mainflux/mainflux.git synced 2025-04-26 13:48:53 +08:00
Dušan Borovčanin 1c6f124062
MF-1053 - Add disconnect event to MQTT adapter (#1056)
* Add disconnect event to mProxy

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Rename publishers to pubs

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Use acync publishers

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2020-03-03 19:23:57 +01:00

29 lines
486 B
Go

// Copyright (c) Mainflux
// SPDX-License-Identifier: Apache-2.0
package redis
type event interface {
Encode() map[string]interface{}
}
var (
_ event = (*mqttEvent)(nil)
)
type mqttEvent struct {
clientID string
timestamp string
eventType string
instance string
}
func (me mqttEvent) Encode() map[string]interface{} {
return map[string]interface{}{
"thing_id": me.clientID,
"timestamp": me.timestamp,
"event_type": me.eventType,
"instance": me.instance,
}
}