Versions in this module Expand all Collapse all v1 v1.2.20 Jan 23, 2025 Changes in this version + func SetMqttSetOnConnectHandler(f func(cli mqtt.Client)) + type EmqGetClientsResp struct + Data []struct{ ... } + Meta struct{ ... } + type EmqResp struct + Code string + Message string + type GetOnlineClientsFilter struct + UserName string + type MqttClient struct + func NewMqttClient(conf *conf.MqttConf) (mcs *MqttClient, err error) + func (m MqttClient) CheckIsOnline(ctx context.Context, clientID string) (bool, error) + func (m MqttClient) GetClientSub(ctx context.Context, clientID string) ([]string, error) + func (m MqttClient) GetOnlineClients(ctx context.Context, f GetOnlineClientsFilter, page *PageInfo) ([]*devices.DevConn, int64, error) + func (m MqttClient) Publish(topic string, qos byte, retained bool, payload interface{}) error + func (m MqttClient) SetClientMutSub(ctx context.Context, clientID string, topics []string, qos int) error + func (m MqttClient) SetClientMutUnSub(ctx context.Context, clientID string, topics []string) error + func (m MqttClient) Subscribe(cli mqtt.Client, topic string, qos byte, callback mqtt.MessageHandler) error + type MutSubReq struct + Nl int + Qos int + Rap int + Rh int + Topic string + type OnlineClientsInfo struct + ClientID string + ConnectedAt time.Time + UserName string + type PageInfo struct + Page int64 + Size int64