Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // MQTTHub client MQTTHub *Client // ModuleContext variable ModuleContext *context.Context // NodeID stands for node id NodeID string // GroupID stands for group id GroupID string // ConnectedTopic to send connect event ConnectedTopic = "$hw/events/connected/%s" // DisconnectedTopic to send disconnect event DisconnectedTopic = "$hw/events/disconnected/%s" // MemberGet to get membership device MemberGet = "$hw/events/edgeGroup/%s/membership/get" // MemberGetRes to get membership device MemberGetRes = "$hw/events/edgeGroup/%s/membership/get/result" // MemberDetail which edge-client should be pub when service start MemberDetail = "$hw/events/edgeGroup/%s/membership/detail" // MemberDetailRes MemberDetail topic resp MemberDetailRes = "$hw/events/edgeGroup/%s/membership/detail/result" // MemberUpdate updating of the twin MemberUpdate = "$hw/events/edgeGroup/%s/membership/updated" // GroupUpdate updates a edgegroup GroupUpdate = "$hw/events/edgeGroup/%s/updated" // GroupAuthGet get temperary aksk from cloudhub GroupAuthGet = "$hw/events/edgeGroup/%s/authInfo/get" // GroupAuthGetRes temperary aksk from cloudhub GroupAuthGetRes = "$hw/events/edgeGroup/%s/authInfo/get/result" // SubTopics which edge-client should be sub SubTopics = []string{ "$hw/events/upload/#", "$hw/events/device/+/state/update", "$hw/events/device/+/twin/+", "$hw/events/node/+/membership/get", "SYS/dis/upload_records", } )
Functions ¶
Types ¶
type AccessInfo ¶
type AccessInfo struct { Name string `json:"name"` Type string `json:"type"` Topic string `json:"topic"` Content []byte `json:"content"` }
AccessInfo that deliever between edge-hub and cloud-hub
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server serve as an internal mqtt broker.
func NewMqttServer ¶
NewMqttServer create an internal mqtt server.
func (*Server) InitInternalTopics ¶
func (m *Server) InitInternalTopics()
InitInternalTopics sets internal topics to server by default.
Click to show internal directories.
Click to hide internal directories.