Documentation ¶
Index ¶
- type BrokerHook
- func (h *BrokerHook) ID() string
- func (h *BrokerHook) Init(config any) error
- func (h *BrokerHook) OnPublish(cl *mqtt.Client, pk packets.Packet) (packets.Packet, error)
- func (h *BrokerHook) OnStarted()
- func (h *BrokerHook) OnStopped()
- func (h *BrokerHook) OnSubscribe(cl *mqtt.Client, pk packets.Packet) packets.Packet
- func (h *BrokerHook) OnSubscribed(cl *mqtt.Client, pk packets.Packet, reasonCodes []byte)
- func (h *BrokerHook) OnUnsubscribe(cl *mqtt.Client, pk packets.Packet) packets.Packet
- func (h *BrokerHook) OnUnsubscribed(cl *mqtt.Client, pk packets.Packet)
- func (h *BrokerHook) Provides(b byte) bool
- func (h *BrokerHook) SetOpts(l *slog.Logger, opts *mqtt.HookOptions)
- func (h *BrokerHook) Stop() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BrokerHook ¶
func (*BrokerHook) Init ¶
func (h *BrokerHook) Init(config any) error
Init performs any pre-start initializations for the hook, such as connecting to databases or opening files.
func (*BrokerHook) OnStarted ¶
func (h *BrokerHook) OnStarted()
OnStarted is called when the server starts.
func (*BrokerHook) OnStopped ¶
func (h *BrokerHook) OnStopped()
OnStopped is called when the server stops.
func (*BrokerHook) OnSubscribe ¶
OnSubscribe is called when a client subscribes to one or more filters.
func (*BrokerHook) OnSubscribed ¶
OnSubscribed is called when a client subscribes to one or more filters.
func (*BrokerHook) OnUnsubscribe ¶
OnUnsubscribe is called when a client unsubscribes from one or more filters.
func (*BrokerHook) OnUnsubscribed ¶
func (h *BrokerHook) OnUnsubscribed(cl *mqtt.Client, pk packets.Packet)
OnUnsubscribed is called when a client unsubscribes from one or more filters.
func (*BrokerHook) Provides ¶
func (h *BrokerHook) Provides(b byte) bool
Provides indicates which methods a hook provides. The default is none - this method should be overridden by the embedding hook.
func (*BrokerHook) SetOpts ¶
func (h *BrokerHook) SetOpts(l *slog.Logger, opts *mqtt.HookOptions)
SetOpts is called by the server to propagate internal values and generally should not be called manually.
func (*BrokerHook) Stop ¶
func (h *BrokerHook) Stop() error
Stop is called to gracefully shut down the hook.