Documentation ¶
Index ¶
- Constants
- Variables
- type ClientInfo
- type Management
- func (m *Management) CloseClient(clientId string) (err error)
- func (m *Management) GetClient(clientId string) (client *ClientInfo, err error)
- func (m *Management) GetClients(limit, offset int) (list []*ClientInfo, total int, err error)
- func (m *Management) GetSession(clientId string) (session *SessionInfo, err error)
- func (m *Management) GetSessions(limit, offset int) (list []*SessionInfo, total int, err error)
- func (m *Management) GetSubscriptions(clientId string, limit, offset int) (list []*SubscriptionInfo, total int, err error)
- func (m *Management) HookWrapper() gmqtt.HookWrapper
- func (m *Management) Load(server gmqtt.Server) error
- func (m *Management) Name() string
- func (m *Management) OnSessionCreatedWrapper(created gmqtt.OnSessionCreated) gmqtt.OnSessionCreated
- func (m *Management) OnSessionResumedWrapper(resumed gmqtt.OnSessionResumed) gmqtt.OnSessionResumed
- func (m *Management) OnSessionTerminatedWrapper(terminated gmqtt.OnSessionTerminated) gmqtt.OnSessionTerminated
- func (m *Management) OnSubscribedWrapper(subscribed gmqtt.OnSubscribed) gmqtt.OnSubscribed
- func (m *Management) OnUnsubscribedWrapper(unsubscribe gmqtt.OnUnsubscribed) gmqtt.OnUnsubscribed
- func (m *Management) Publish(topic string, qos int, payload []byte, retain bool) (err error)
- func (m *Management) SearchTopic(query string) (result []*SubscriptionInfo, err error)
- func (m *Management) Subscribe(clientId, topic string, qos int) (err error)
- func (m *Management) Unload() error
- func (m *Management) Unsubscribe(clientId, topic string) (err error)
- type SessionInfo
- type SubscriptionInfo
Constants ¶
View Source
const ( Online = "online" Offline = "offline" )
Variables ¶
View Source
var ErrNotFound = errors.New("not found")
Functions ¶
This section is empty.
Types ¶
type ClientInfo ¶
type ClientInfo struct { ClientID string `json:"client_id"` Username string `json:"username"` Password string `json:"password"` KeepAlive uint16 `json:"keep_alive"` CleanSession bool `json:"clean_session"` WillFlag bool `json:"will_flag"` WillRetain bool `json:"will_retain"` WillQos uint8 `json:"will_qos"` WillTopic string `json:"will_topic"` WillPayload string `json:"will_payload"` RemoteAddr string `json:"remote_addr"` LocalAddr string `json:"local_addr"` ConnectedAt time.Time `json:"connected_at"` DisconnectedAt time.Time `json:"disconnected_at"` }
ClientInfo represents the client information
type Management ¶
type Management struct {
// contains filtered or unexported fields
}
func New ¶ added in v0.1.0
func New() *Management
func (*Management) CloseClient ¶
func (m *Management) CloseClient(clientId string) (err error)
CloseClient
func (*Management) GetClient ¶
func (m *Management) GetClient(clientId string) (client *ClientInfo, err error)
GetClient
func (*Management) GetClients ¶
func (m *Management) GetClients(limit, offset int) (list []*ClientInfo, total int, err error)
GetClients
func (*Management) GetSession ¶
func (m *Management) GetSession(clientId string) (session *SessionInfo, err error)
GetSession
func (*Management) GetSessions ¶
func (m *Management) GetSessions(limit, offset int) (list []*SessionInfo, total int, err error)
GetSessions
func (*Management) GetSubscriptions ¶
func (m *Management) GetSubscriptions(clientId string, limit, offset int) (list []*SubscriptionInfo, total int, err error)
GetSubscriptions
func (*Management) HookWrapper ¶
func (m *Management) HookWrapper() gmqtt.HookWrapper
func (*Management) Name ¶
func (m *Management) Name() string
func (*Management) OnSessionCreatedWrapper ¶
func (m *Management) OnSessionCreatedWrapper(created gmqtt.OnSessionCreated) gmqtt.OnSessionCreated
OnSessionCreatedWrapper store the client when session created
func (*Management) OnSessionResumedWrapper ¶
func (m *Management) OnSessionResumedWrapper(resumed gmqtt.OnSessionResumed) gmqtt.OnSessionResumed
OnSessionResumedWrapper refresh the client when session resumed
func (*Management) OnSessionTerminatedWrapper ¶
func (m *Management) OnSessionTerminatedWrapper(terminated gmqtt.OnSessionTerminated) gmqtt.OnSessionTerminated
OnSessionTerminated remove the client when session terminated
func (*Management) OnSubscribedWrapper ¶
func (m *Management) OnSubscribedWrapper(subscribed gmqtt.OnSubscribed) gmqtt.OnSubscribed
OnSubscribedWrapper store the subscription
func (*Management) OnUnsubscribedWrapper ¶
func (m *Management) OnUnsubscribedWrapper(unsubscribe gmqtt.OnUnsubscribed) gmqtt.OnUnsubscribed
OnUnsubscribedWrapper remove the subscription
func (*Management) SearchTopic ¶ added in v0.0.21
func (m *Management) SearchTopic(query string) (result []*SubscriptionInfo, err error)
SearchTopic
func (*Management) Subscribe ¶
func (m *Management) Subscribe(clientId, topic string, qos int) (err error)
Subscribe
func (*Management) Unload ¶
func (m *Management) Unload() error
func (*Management) Unsubscribe ¶
func (m *Management) Unsubscribe(clientId, topic string) (err error)
Unsubscribe
type SessionInfo ¶
type SessionInfo struct { ClientID string `json:"client_id"` Status string `json:"status"` CleanSession bool `json:"clean_session"` Subscriptions uint64 `json:"subscriptions"` MaxInflight int `json:"max_inflight"` InflightLen uint64 `json:"inflight_len"` MaxMsgQueue int `json:"max_msg_queue"` MsgQueueLen uint64 `json:"msg_queue_len"` MaxAwaitRel int `json:"max_await_rel"` AwaitRelLen uint64 `json:"await_rel_len"` Qos0MsgDroppedTotal uint64 `json:"qos0_msg_dropped_total"` Qos1MsgDroppedTotal uint64 `json:"qos1_msg_dropped_total"` Qos2MsgDroppedTotal uint64 `json:"qos2_msg_dropped_total"` Qos0MsgDeliveredTotal uint64 `json:"qos0_msg_delivered_total"` Qos1MsgDeliveredTotal uint64 `json:"qos1_msg_delivered_total"` Qos2MsgDeliveredTotal uint64 `json:"qos2_msg_delivered_total"` ConnectedAt time.Time `json:"connected_at"` DisconnectedAt time.Time `json:"disconnected_at"` }
SessionInfo represents the session information
Click to show internal directories.
Click to hide internal directories.