Versions in this module Expand all Collapse all v0 v0.21.1 Nov 6, 2024 v0.21.0 Oct 28, 2024 Changes in this version + const Name + const Offline + const Online + var ErrInvalidClientID = errors.New("invalid clientID") + var ErrInvalidQos = errors.New("invalid Qos") + var ErrInvalidTopicFilter = errors.New("invalid topic filter") + var ErrInvalidUtf8String = errors.New("invalid utf-8 string") + var ErrNotFound = errors.New("not found") + func GetOffsetN(page, pageSize uint) (offset, n uint) + type Admin struct + func New() *Admin + func (a *Admin) CloseClient(clientId string) (err error) + func (a *Admin) GetClient(clientId string) (client *ClientInfo, err error) + func (a *Admin) GetClients(limit, offset uint) (list []*ClientInfo, total uint32, err error) + func (a *Admin) GetSession(clientId string) (session *SessionInfo, err error) + func (a *Admin) GetSessions(limit, offset uint) (list []*SessionInfo, total int, err error) + func (a *Admin) GetSubscriptions(clientId string, limit, offset uint) (list []*SubscriptionInfo, total int, err error) + func (a *Admin) HookWrapper() server.HookWrapper + func (a *Admin) Load(service server.Server) error + func (a *Admin) Name() string + func (a *Admin) OnClosedWrapper(pre server.OnClosed) server.OnClosed + func (a *Admin) OnSessionCreatedWrapper(pre server.OnSessionCreated) server.OnSessionCreated + func (a *Admin) OnSessionResumedWrapper(pre server.OnSessionResumed) server.OnSessionResumed + func (a *Admin) OnSessionTerminatedWrapper(pre server.OnSessionTerminated) server.OnSessionTerminated + func (a *Admin) OnSubscribedWrapper(pre server.OnSubscribed) server.OnSubscribed + func (a *Admin) OnUnsubscribedWrapper(pre server.OnUnsubscribed) server.OnUnsubscribed + func (a *Admin) Publish(topic string, qos int, payload []byte, retain bool) (err error) + func (a *Admin) SearchTopic(query string) (result []*SubscriptionInfo, err error) + func (a *Admin) Subscribe(clientId, topic string, qos int) (err error) + func (a *Admin) Unload() error + func (a *Admin) Unsubscribe(clientId, topic string) (err error) + type ClientInfo struct + ClientID string + ConnectedAt time.Time + DisconnectedAt *time.Time + InflightLen uint32 + KeepAlive uint16 + LocalAddr string + MessageDropped uint64 + PacketsReceivedBytes uint64 + PacketsReceivedNums uint64 + PacketsSendBytes uint64 + PacketsSendNums uint64 + QueueLen uint32 + RemoteAddr string + SubscriptionsCurrent uint32 + SubscriptionsTotal uint32 + Username string + Version int32 + WillPayload string + WillQos uint8 + WillRetain bool + WillTopic string + type Indexer struct + func NewIndexer() *Indexer + func (i *Indexer) GetByID(id string) *list.Element + func (i *Indexer) Iterate(fn func(elem *list.Element), offset, n uint) + func (i *Indexer) Len() int + func (i *Indexer) Remove(id string) *list.Element + func (i *Indexer) Set(id string, value interface{}) + type SessionInfo struct + AwaitRelLen uint64 + CleanSession bool + ClientID string + ConnectedAt *time.Time + DisconnectedAt *time.Time + InflightLen uint64 + MaxInflight uint16 + MaxMsgQueue int + MsgQueueLen uint64 + Qos0MsgDeliveredTotal uint64 + Qos0MsgDroppedTotal uint64 + Qos1MsgDeliveredTotal uint64 + Qos1MsgDroppedTotal uint64 + Qos2MsgDeliveredTotal uint64 + Qos2MsgDroppedTotal uint64 + Status string + Subscriptions uint64 + type SubscriptionInfo struct + ClientID string + Id uint32 + Name string + NoLocal bool + Qos uint32 + RetainAsPublished bool + RetainHandling uint32 + TopicName string