subDev

package
v1.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2024 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ShareSubTopicPrefix emqx 共享订阅前缀 参考: https://docs.emqx.com/zh/enterprise/v4.4/advanced/shared-subscriptions.html
	ShareSubTopicPrefix = "$share/dg.rpc/"
	// TopicConnectStatus emqx 客户端上下线通知 参考: https://docs.emqx.com/zh/enterprise/v4.4/advanced/system-topic.html#客户端上下线事件
	TopicConnectStatus = ShareSubTopicPrefix + "$SYS/brokers/+/clients/#"

	TopicThing   = ShareSubTopicPrefix + devices.TopicHeadThing + "/up/#"
	TopicOta     = ShareSubTopicPrefix + devices.TopicHeadOta + "/up/#"
	TopicConfig  = ShareSubTopicPrefix + devices.TopicHeadConfig + "/up/#"
	TopicSDKLog  = ShareSubTopicPrefix + devices.TopicHeadLog + "/up/#"
	TopicShadow  = ShareSubTopicPrefix + devices.TopicHeadShadow + "/up/#"
	TopicGateway = ShareSubTopicPrefix + devices.TopicHeadGateway + "/up/#"
	TopicExt     = ShareSubTopicPrefix + devices.TopicHeadExt + "/up/#"
)

Variables

This section is empty.

Functions

func Check

func Check(conf conf.DevLinkConf) error

Types

type ConnectMsg

type ConnectMsg struct {
	UserName string `json:"username"`
	Ts       int64  `json:"ts"`
	Address  string `json:"ipaddress"`
	ClientID string `json:"clientid"`
	Reason   string `json:"reason"`
}

登录登出消息

type DevSubHandle

type DevSubHandle interface {
	ExtMsg(topic string, payload []byte) error
	Msg(topic string, payload []byte) error
	Connected(out *devices.DevConn) error
	Disconnected(out *devices.DevConn) error
}

type Handle

type Handle func(ctx context.Context) DevSubHandle

type MqttClient

type MqttClient struct {
	// contains filtered or unexported fields
}

func (*MqttClient) SubDevMsg

func (d *MqttClient) SubDevMsg(handle Handle) error

type SubDev

type SubDev interface {
	SubDevMsg(handle Handle) error
}

func NewSubDev

func NewSubDev(conf conf.DevLinkConf) (SubDev, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL