Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterProvider ¶
func RegisterProvider(f func() StoreMgr)
Types ¶
type InflightStore ¶
type InflightStore interface { //以ClientId&MsgId作key SaveByClientIdMsgId(msg *Msg) error //以Topic作为key SaveRetainMsg(topic string, body []byte, qos byte) error GetMsgByClientIdMsgId(clientId string, msgId uint16) (msg *Msg, err error) //根据消息Id删除消息 RemoveMsgById(id int) error }
发送中的消息存储
type ProviderFactory ¶
type ProviderFactory func() StoreMgr
type RetainStore ¶
type RetainStore interface { //Retain消息 //获取所有离线消息 GetAllRetainMsgs() (msgs []*Msg, err error) //删除topic的离线消息 RemoveMsgByTopic(topic string) error }
相关题的最后一条离线消息存储
type StoreMgr ¶
type StoreMgr interface { InflightStore RetainStore }
func NewStoreMgr ¶
func NewStoreMgr() StoreMgr
Click to show internal directories.
Click to hide internal directories.