Documentation ¶
Index ¶
- Constants
- Variables
- type ClientInfo
- type Management
- func (m *Management) CloseClient(c *gin.Context)
- func (m *Management) GetClient(c *gin.Context)
- func (m *Management) GetClients(c *gin.Context)
- func (m *Management) GetSession(c *gin.Context)
- func (m *Management) GetSessions(c *gin.Context)
- func (m *Management) GetSubscriptions(c *gin.Context)
- 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(c *gin.Context)
- func (m *Management) Subscribe(c *gin.Context)
- func (m *Management) Unload() error
- func (m *Management) Unsubscribe(c *gin.Context)
- type Pager
- type Response
- type SessionInfo
- type SubscriptionInfo
Constants ¶
const ( Online = "online" Offline = "offline" )
const CodeErr = -1
const CodeOK = 0
Variables ¶
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 (*Management) CloseClient ¶
func (m *Management) CloseClient(c *gin.Context)
CloseClient is the handle function for "Delete /client/:id" which close the client specified by the id
func (*Management) GetClient ¶
func (m *Management) GetClient(c *gin.Context)
GetSessions is the handle function for "/client/:id"
func (*Management) GetClients ¶
func (m *Management) GetClients(c *gin.Context)
GetClients is the handle function for "/clients"
func (*Management) GetSession ¶
func (m *Management) GetSession(c *gin.Context)
GetSessions is the handle function for "/session/:id"
func (*Management) GetSessions ¶
func (m *Management) GetSessions(c *gin.Context)
GetSessions is the handle function for "/sessions"
func (*Management) GetSubscriptions ¶
func (m *Management) GetSubscriptions(c *gin.Context)
GetSessions is the handle function for "/subscriptions/:clientID"
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) Publish ¶
func (m *Management) Publish(c *gin.Context)
Publish is the handle function for "/publish" which publish a message to the server
func (*Management) Subscribe ¶
func (m *Management) Subscribe(c *gin.Context)
Subscribe is the handle function for "/subscribe" which make a subscription for a client
func (*Management) Unload ¶
func (m *Management) Unload() error
func (*Management) Unsubscribe ¶
func (m *Management) Unsubscribe(c *gin.Context)
Unsubscribe is the handle function for "/unsubscribe" which unsubscribe the topic for the client
type Pager ¶
type Pager struct { Page int `json:"page"` PageSize int `json:"page_size"` Count int `json:"count"` }
Pager
type Response ¶
type Response struct { Code int `json:"code"` Message string `json:"message"` Data interface{} `json:"data"` }
Response is the response for the api server
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