Documentation ¶
Overview ¶
SPDX-License-Identifier: MIT SPDX-FileCopyrightText: 2022 mochi-co SPDX-FileContributor: mochi-co package bolt is provided for historical compatibility and may not be actively updated, you should use the badger hook instead.
Index ¶
- type Hook
- func (h *Hook) ID() string
- func (h *Hook) Init(config any) error
- func (h *Hook) OnClientExpired(cl *mqtt.Client)
- func (h *Hook) OnDisconnect(cl *mqtt.Client, _ error, expire bool)
- func (h *Hook) OnQosComplete(cl *mqtt.Client, pk packets.Packet)
- func (h *Hook) OnQosDropped(cl *mqtt.Client, pk packets.Packet)
- func (h *Hook) OnQosPublish(cl *mqtt.Client, pk packets.Packet, sent int64, resends int)
- func (h *Hook) OnRetainMessage(cl *mqtt.Client, pk packets.Packet, r int64)
- func (h *Hook) OnRetainedExpired(filter string)
- func (h *Hook) OnSessionEstablished(cl *mqtt.Client, pk packets.Packet)
- func (h *Hook) OnSubscribed(cl *mqtt.Client, pk packets.Packet, reasonCodes []byte)
- func (h *Hook) OnSysInfoTick(sys *system.Info)
- func (h *Hook) OnUnsubscribed(cl *mqtt.Client, pk packets.Packet)
- func (h *Hook) OnWillSent(cl *mqtt.Client, pk packets.Packet)
- func (h *Hook) Provides(b byte) bool
- func (h *Hook) Stop() error
- func (h *Hook) StoredClients() (v []storage.Client, err error)
- func (h *Hook) StoredInflightMessages() (v []storage.Message, err error)
- func (h *Hook) StoredRetainedMessages() (v []storage.Message, err error)
- func (h *Hook) StoredSubscriptions() (v []storage.Subscription, err error)
- func (h *Hook) StoredSysInfo() (v storage.SystemInfo, err error)
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Hook ¶
type Hook struct { mqtt.HookBase // contains filtered or unexported fields }
Hook is a persistent storage hook based using boltdb file store as a backend.
func (*Hook) OnClientExpired ¶
func (h *Hook) OnClientExpired(cl *mqtt.Client)
OnClientExpired deleted expired clients from the store.
func (*Hook) OnDisconnect ¶
OnDisconnect removes a client from the store if they were using a clean session.
func (*Hook) OnQosComplete ¶
OnQosComplete removes a resolved inflight message from the store.
func (*Hook) OnQosDropped ¶
OnQosDropped removes a dropped inflight message from the store.
func (*Hook) OnQosPublish ¶
OnQosPublish adds or updates an inflight message in the store.
func (*Hook) OnRetainMessage ¶
OnRetainMessage adds a retained message for a topic to the store.
func (*Hook) OnRetainedExpired ¶
OnRetainedExpired deletes expired retained messages from the store.
func (*Hook) OnSessionEstablished ¶
OnSessionEstablished adds a client to the store when their session is established.
func (*Hook) OnSubscribed ¶
OnSubscribed adds one or more client subscriptions to the store.
func (*Hook) OnSysInfoTick ¶
OnSysInfoTick stores the latest system info in the store.
func (*Hook) OnUnsubscribed ¶
OnUnsubscribed removes one or more client subscriptions from the store.
func (*Hook) OnWillSent ¶
OnWillSent is called when a client sends a will message and the will message is removed from the client record.
func (*Hook) StoredClients ¶
StoredClients returns all stored clients from the store.
func (*Hook) StoredInflightMessages ¶
StoredInflightMessages returns all stored inflight messages from the store.
func (*Hook) StoredRetainedMessages ¶
StoredRetainedMessages returns all stored retained messages from the store.
func (*Hook) StoredSubscriptions ¶
func (h *Hook) StoredSubscriptions() (v []storage.Subscription, err error)
StoredSubscriptions returns all stored subscriptions from the store.
func (*Hook) StoredSysInfo ¶
func (h *Hook) StoredSysInfo() (v storage.SystemInfo, err error)
StoredSysInfo returns the system info from the store.