Documentation ¶
Index ¶
- type Options
- type Storage
- func (s *Storage) ID() string
- func (s *Storage) Init(config any) error
- func (s *Storage) OnClientExpired(cl *mqtt.Client)
- func (s *Storage) OnDisconnect(cl *mqtt.Client, _ error, expire bool)
- func (s *Storage) OnQosComplete(cl *mqtt.Client, pk packets.Packet)
- func (s *Storage) OnQosDropped(cl *mqtt.Client, pk packets.Packet)
- func (s *Storage) OnQosPublish(cl *mqtt.Client, pk packets.Packet, sent int64, resends int)
- func (s *Storage) OnRetainMessage(cl *mqtt.Client, pk packets.Packet, r int64)
- func (s *Storage) OnRetainedExpired(filter string)
- func (s *Storage) OnSessionEstablished(cl *mqtt.Client, pk packets.Packet)
- func (s *Storage) OnSubscribed(cl *mqtt.Client, pk packets.Packet, reasonCodes []byte, counts []int)
- func (s *Storage) OnSysInfoTick(sys *system.Info)
- func (s *Storage) OnUnsubscribed(cl *mqtt.Client, pk packets.Packet, reasonCodes []byte, counts []int)
- func (s *Storage) OnWillSent(cl *mqtt.Client, pk packets.Packet)
- func (s *Storage) Provides(b byte) bool
- func (s *Storage) Stop() error
- func (s *Storage) StoredClientByCid(cid string) (v storage.Client, err error)
- func (s *Storage) StoredInflightMessagesByCid(cid string) (v []storage.Message, err error)
- func (s *Storage) StoredRetainedMessageByTopic(topic string) (v storage.Message, err error)
- func (s *Storage) StoredSubscriptionsByCid(cid string) (v []storage.Subscription, err error)
- func (s *Storage) StoredSysInfo() (v storage.SystemInfo, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Storage ¶
Storage is a persistent storage hook based using Redis as a backend.
func (*Storage) OnClientExpired ¶
OnClientExpired deleted expired clients from the store.
func (*Storage) OnDisconnect ¶
OnDisconnect removes a client from the store if they were using a clean session.
func (*Storage) OnQosComplete ¶
OnQosComplete removes a resolved inflight message from the store.
func (*Storage) OnQosDropped ¶
OnQosDropped removes a dropped inflight message from the store.
func (*Storage) OnQosPublish ¶
OnQosPublish adds or updates an inflight message in the store.
func (*Storage) OnRetainMessage ¶
OnRetainMessage adds a retained message for a topic to the store.
func (*Storage) OnRetainedExpired ¶
OnRetainedExpired deletes expired retained messages from the store.
func (*Storage) OnSessionEstablished ¶
OnSessionEstablished adds a client to the store when their session is established.
func (*Storage) OnSubscribed ¶
func (s *Storage) OnSubscribed(cl *mqtt.Client, pk packets.Packet, reasonCodes []byte, counts []int)
OnSubscribed adds one or more client subscriptions to the store.
func (*Storage) OnSysInfoTick ¶
OnSysInfoTick stores the latest system info in the store.
func (*Storage) OnUnsubscribed ¶
func (s *Storage) OnUnsubscribed(cl *mqtt.Client, pk packets.Packet, reasonCodes []byte, counts []int)
OnUnsubscribed removes one or more client subscriptions from the store.
func (*Storage) OnWillSent ¶
OnWillSent is called when a client sends a will message and the will message is removed from the client record.
func (*Storage) StoredClientByCid ¶
StoredClientByCid returns a stored client from the store.
func (*Storage) StoredInflightMessagesByCid ¶
StoredInflightMessagesByCid returns all stored inflight messages of client from the store.
func (*Storage) StoredRetainedMessageByTopic ¶
StoredRetainedMessageByTopic returns a stored retained message of topic from the store.
func (*Storage) StoredSubscriptionsByCid ¶
func (s *Storage) StoredSubscriptionsByCid(cid string) (v []storage.Subscription, err error)
StoredSubscriptionsByCid returns all stored subscriptions of client from the store.
func (*Storage) StoredSysInfo ¶
func (s *Storage) StoredSysInfo() (v storage.SystemInfo, err error)
StoredSysInfo returns the system info from the store.