mqttcluster

package module
v0.0.0-...-eec9364 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

README

mochi-mqtt-cluster

Mochi MQTT broker with clustering capabilities

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BrokerHook

type BrokerHook struct {
	mqtt.HookBase
}

func (*BrokerHook) ID

func (h *BrokerHook) ID() string

ID returns the ID of the hook.

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) OnPublish

func (h *BrokerHook) OnPublish(cl *mqtt.Client, pk packets.Packet) (packets.Packet, error)

OnPublish is called when a client publishes a message.

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

func (h *BrokerHook) OnSubscribe(cl *mqtt.Client, pk packets.Packet) packets.Packet

OnSubscribe is called when a client subscribes to one or more filters.

func (*BrokerHook) OnSubscribed

func (h *BrokerHook) OnSubscribed(cl *mqtt.Client, pk packets.Packet, reasonCodes []byte)

OnSubscribed is called when a client subscribes to one or more filters.

func (*BrokerHook) OnUnsubscribe

func (h *BrokerHook) OnUnsubscribe(cl *mqtt.Client, pk packets.Packet) packets.Packet

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL