Documentation ¶
Index ¶
- Constants
- Variables
- func Added(context *dtcontext.DTContext, toAdd []dttype.Device, ...)
- func DealDeviceTwin(context *dtcontext.DTContext, deviceID string, eventID string, ...) error
- func DealGetMembership(context *dtcontext.DTContext, payload []byte) error
- func DealGetTwin(context *dtcontext.DTContext, deviceID string, payload []byte) error
- func DealMsgAttr(context *dtcontext.DTContext, deviceID string, ...) dttype.DealAttrResult
- func DealMsgTwin(context *dtcontext.DTContext, deviceID string, ...) dttype.DealTwinResult
- func DeviceUpdated(context *dtcontext.DTContext, deviceID string, ...) (interface{}, error)
- func Removed(context *dtcontext.DTContext, toRemove []dttype.Device, ...)
- func SyncDeviceFromSqlite(context *dtcontext.DTContext, deviceID string) error
- func Updated(context *dtcontext.DTContext, deviceID string, payload []byte)
- type CallBack
- type CommWorker
- type DTWorker
- type DeviceWorker
- type MemWorker
- type TwinWorker
- type Worker
Constants ¶
View Source
const ( //RestDealType update from mqtt RestDealType = 0 //SyncDealType update form cloud sync SyncDealType = 1 //DetailDealType detail update from cloud DetailDealType = 2 //SyncTwinDeleteDealType twin delete when sync SyncTwinDeleteDealType = 3 //DealActual deal actual DealActual = 1 //DealExpected deal exepected DealExpected = 0 )
Variables ¶
View Source
var ( //ActionCallBack map for action to callback ActionCallBack map[string]CallBack )
Functions ¶
func Added ¶
func Added(context *dtcontext.DTContext, toAdd []dttype.Device, baseMessage dttype.BaseMessage, delta bool)
Added add device to the edge group
func DealDeviceTwin ¶
func DealDeviceTwin(context *dtcontext.DTContext, deviceID string, eventID string, msgTwin map[string]*dttype.MsgTwin, dealType int) error
DealDeviceTwin deal device twin
func DealGetMembership ¶
DealGetMembership deal get membership event
func DealGetTwin ¶
DealGetTwin deal get twin event
func DealMsgAttr ¶
func DealMsgAttr(context *dtcontext.DTContext, deviceID string, msgAttrs map[string]*dttype.MsgAttr, dealType int) dttype.DealAttrResult
DealMsgAttr get diff,0:update, 1:detail
func DealMsgTwin ¶
func DealMsgTwin(context *dtcontext.DTContext, deviceID string, msgTwins map[string]*dttype.MsgTwin, dealType int) dttype.DealTwinResult
DealMsgTwin get diff while updating twin
func DeviceUpdated ¶
func DeviceUpdated(context *dtcontext.DTContext, deviceID string, attributes map[string]*dttype.MsgAttr, baseMessage dttype.BaseMessage, dealType int) (interface{}, error)
DeviceUpdated update device attributes
func Removed ¶
func Removed(context *dtcontext.DTContext, toRemove []dttype.Device, baseMessage dttype.BaseMessage, delta bool)
Removed remove device from the edge group
func SyncDeviceFromSqlite ¶
SyncDeviceFromSqlite sync device from sqlite
Types ¶
type CommWorker ¶
CommWorker deal app response event
type DeviceWorker ¶
DeviceWorker deal device event
type TwinWorker ¶
TwinWorker deal twin event
Click to show internal directories.
Click to hide internal directories.