Documentation ¶
Index ¶
- func SetMqttSetOnConnectHandler(f func(cli mqtt.Client))
- type EmqGetClientsResp
- type EmqResp
- type GetOnlineClientsFilter
- type MqttClient
- 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
- type OnlineClientsInfo
- type PageInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EmqGetClientsResp ¶
type EmqGetClientsResp struct { Data []struct { HeapSize int `json:"heap_size"` SendMsgDroppedExpired int `json:"send_msg.dropped.expired"` SendOct int `json:"send_oct"` RecvMsgQos1 int `json:"recv_msg.qos1"` IsPersistent bool `json:"is_persistent"` SendPkt int `json:"send_pkt"` CleanStart bool `json:"clean_start"` InflightCnt int `json:"inflight_cnt"` Node string `json:"node"` SendMsgDroppedQueueFull int `json:"send_msg.dropped.queue_full"` AwaitingRelCnt int `json:"awaiting_rel_cnt"` InflightMax int `json:"inflight_max"` CreatedAt time.Time `json:"created_at"` SubscriptionsCnt int `json:"subscriptions_cnt"` MailboxLen int `json:"mailbox_len"` SendCnt int `json:"send_cnt"` Connected bool `json:"connected"` IpAddress string `json:"ip_address"` AwaitingRelMax int `json:"awaiting_rel_max"` RecvMsgQos2 int `json:"recv_msg.qos2"` ProtoVer int `json:"proto_ver"` Mountpoint string `json:"mountpoint"` ProtoName string `json:"proto_name"` Port int `json:"port"` ConnectedAt time.Time `json:"connected_at"` EnableAuthn bool `json:"enable_authn"` ExpiryInterval int `json:"expiry_interval"` Username *string `json:"username"` RecvMsg int `json:"recv_msg"` RecvOct int `json:"recv_oct"` SendMsgDroppedTooLarge int `json:"send_msg.dropped.too_large"` Keepalive int `json:"keepalive"` SendMsgQos1 int `json:"send_msg.qos1"` SendMsgQos2 int `json:"send_msg.qos2"` RecvMsgQos0 int `json:"recv_msg.qos0"` SendMsgQos0 int `json:"send_msg.qos0"` SubscriptionsMax string `json:"subscriptions_max"` MqueueMax int `json:"mqueue_max"` MqueueDropped int `json:"mqueue_dropped"` Clientid string `json:"clientid"` IsBridge bool `json:"is_bridge"` Peerport int `json:"peerport"` SendMsg int `json:"send_msg"` Listener string `json:"listener"` RecvCnt int `json:"recv_cnt"` RecvPkt int `json:"recv_pkt"` RecvMsgDropped int `json:"recv_msg.dropped"` SendMsgDropped int `json:"send_msg.dropped"` RecvMsgDroppedAwaitPubrelTimeout int `json:"recv_msg.dropped.await_pubrel_timeout"` Reductions int `json:"reductions"` MqueueLen int `json:"mqueue_len"` } `json:"data"` Meta struct { Count int64 `json:"count"` Hasnext bool `json:"hasnext"` Limit int `json:"limit"` Page int `json:"page"` } `json:"meta"` }
type GetOnlineClientsFilter ¶
type GetOnlineClientsFilter struct {
UserName string
}
type MqttClient ¶
type MqttClient struct {
// contains filtered or unexported fields
}
func NewMqttClient ¶
func NewMqttClient(conf *conf.MqttConf) (mcs *MqttClient, err error)
func (MqttClient) CheckIsOnline ¶
https://www.emqx.io/docs/zh/v5.5/admin/api-docs.html#tag/Clients/paths/~1clients~1%7Bclientid%7D/get
func (MqttClient) GetClientSub ¶
func (MqttClient) GetOnlineClients ¶
func (m MqttClient) GetOnlineClients(ctx context.Context, f GetOnlineClientsFilter, page *PageInfo) ([]*devices.DevConn, int64, error)
func (MqttClient) Publish ¶
func (m MqttClient) Publish(topic string, qos byte, retained bool, payload interface{}) error
func (MqttClient) SetClientMutSub ¶
func (MqttClient) SetClientMutUnSub ¶
func (MqttClient) Subscribe ¶
func (m MqttClient) Subscribe(cli mqtt.Client, topic string, qos byte, callback mqtt.MessageHandler) error
type OnlineClientsInfo ¶
Click to show internal directories.
Click to hide internal directories.