hooks

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClearRetainedHook

type ClearRetainedHook struct {
	mqtt.HookBase
	// contains filtered or unexported fields
}

func NewClearRetainedHook

func NewClearRetainedHook(server *mqtt.Server) *ClearRetainedHook

func (*ClearRetainedHook) ID

func (h *ClearRetainedHook) ID() string

func (*ClearRetainedHook) OnWillSent

func (h *ClearRetainedHook) OnWillSent(cl *mqtt.Client, pk packets.Packet)

func (*ClearRetainedHook) Provides

func (h *ClearRetainedHook) Provides(b byte) bool

type ClientPSKHook

type ClientPSKHook struct {
	PreSharedKey string

	mqtt.HookBase
	// contains filtered or unexported fields
}

func NewClientPSKHook

func NewClientPSKHook(ctx context.Context, psk string) *ClientPSKHook

func (*ClientPSKHook) ID

func (h *ClientPSKHook) ID() string

func (*ClientPSKHook) OnACLCheck

func (h *ClientPSKHook) OnACLCheck(cl *mqtt.Client, topic string, write bool) bool

func (*ClientPSKHook) OnConnectAuthenticate

func (h *ClientPSKHook) OnConnectAuthenticate(cl *mqtt.Client, pk packets.Packet) bool

func (*ClientPSKHook) Provides

func (h *ClientPSKHook) Provides(b byte) bool

type DesktopPSKHook

type DesktopPSKHook struct {
	PreSharedKey string

	mqtt.HookBase
	// contains filtered or unexported fields
}

func NewDesktopPSKHook

func NewDesktopPSKHook(ctx context.Context, psk string) *DesktopPSKHook

func (*DesktopPSKHook) ID

func (h *DesktopPSKHook) ID() string

func (*DesktopPSKHook) OnACLCheck

func (h *DesktopPSKHook) OnACLCheck(cl *mqtt.Client, topic string, write bool) bool

func (*DesktopPSKHook) OnConnectAuthenticate

func (h *DesktopPSKHook) OnConnectAuthenticate(cl *mqtt.Client, pk packets.Packet) bool

func (*DesktopPSKHook) Provides

func (h *DesktopPSKHook) Provides(b byte) bool

type LogHook

type LogHook struct {
	mqtt.HookBase
	// contains filtered or unexported fields
}

func NewHookLogger

func NewHookLogger(logger zerolog.Logger) *LogHook

func (*LogHook) ID

func (h *LogHook) ID() string

func (*LogHook) OnAuthPacket

func (h *LogHook) OnAuthPacket(cl *mqtt.Client, pk packets.Packet) (packets.Packet, error)

func (*LogHook) OnClientExpired

func (h *LogHook) OnClientExpired(cl *mqtt.Client)

func (*LogHook) OnConnect

func (h *LogHook) OnConnect(cl *mqtt.Client, pk packets.Packet) error

func (*LogHook) OnDisconnect

func (h *LogHook) OnDisconnect(cl *mqtt.Client, err error, expire bool)

func (*LogHook) OnPacketEncode

func (h *LogHook) OnPacketEncode(cl *mqtt.Client, pk packets.Packet) packets.Packet

func (*LogHook) OnPacketIDExhausted

func (h *LogHook) OnPacketIDExhausted(cl *mqtt.Client, pk packets.Packet)

func (*LogHook) OnPacketProcessed

func (h *LogHook) OnPacketProcessed(cl *mqtt.Client, pk packets.Packet, err error)

func (*LogHook) OnPacketRead

func (h *LogHook) OnPacketRead(cl *mqtt.Client, pk packets.Packet) (packets.Packet, error)

func (*LogHook) OnPacketSent

func (h *LogHook) OnPacketSent(cl *mqtt.Client, pk packets.Packet, b []byte)

func (*LogHook) OnPublish

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

func (*LogHook) OnPublishDropped

func (h *LogHook) OnPublishDropped(cl *mqtt.Client, pk packets.Packet)

func (*LogHook) OnPublished

func (h *LogHook) OnPublished(cl *mqtt.Client, pk packets.Packet)

func (*LogHook) OnQosComplete

func (h *LogHook) OnQosComplete(cl *mqtt.Client, pk packets.Packet)

func (*LogHook) OnQosDropped

func (h *LogHook) OnQosDropped(cl *mqtt.Client, pk packets.Packet)

func (*LogHook) OnQosPublish

func (h *LogHook) OnQosPublish(cl *mqtt.Client, pk packets.Packet, sent int64, resends int)

func (*LogHook) OnRetainMessage

func (h *LogHook) OnRetainMessage(cl *mqtt.Client, pk packets.Packet, r int64)

func (*LogHook) OnRetainPublished

func (h *LogHook) OnRetainPublished(cl *mqtt.Client, pk packets.Packet)

func (*LogHook) OnRetainedExpired

func (h *LogHook) OnRetainedExpired(filter string)

func (*LogHook) OnSelectSubscribers

func (h *LogHook) OnSelectSubscribers(subs *mqtt.Subscribers, pk packets.Packet) *mqtt.Subscribers

func (*LogHook) OnSessionEstablish

func (h *LogHook) OnSessionEstablish(cl *mqtt.Client, pk packets.Packet)

func (*LogHook) OnSessionEstablished

func (h *LogHook) OnSessionEstablished(cl *mqtt.Client, pk packets.Packet)

func (*LogHook) OnStarted

func (h *LogHook) OnStarted()

func (*LogHook) OnStopped

func (h *LogHook) OnStopped()

func (*LogHook) OnSubscribe

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

func (*LogHook) OnSubscribed

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

func (*LogHook) OnUnsubscribe

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

func (*LogHook) OnUnsubscribed

func (h *LogHook) OnUnsubscribed(cl *mqtt.Client, pk packets.Packet)

func (*LogHook) OnWill

func (h *LogHook) OnWill(cl *mqtt.Client, will mqtt.Will) (mqtt.Will, error)

func (*LogHook) OnWillSent

func (h *LogHook) OnWillSent(cl *mqtt.Client, pk packets.Packet)

func (*LogHook) Provides

func (h *LogHook) Provides(b byte) bool

type OpenIDConnectHook

type OpenIDConnectHook struct {
	OIDCServer   string
	OIDCClientId string

	mqtt.HookBase
	// contains filtered or unexported fields
}

func NewOIDCHook

func NewOIDCHook(ctx context.Context, oauthServer string, oauthClientId string) *OpenIDConnectHook

func (*OpenIDConnectHook) ID

func (h *OpenIDConnectHook) ID() string

func (*OpenIDConnectHook) Init

func (h *OpenIDConnectHook) Init(config any) error

func (*OpenIDConnectHook) OnACLCheck

func (h *OpenIDConnectHook) OnACLCheck(cl *mqtt.Client, topic string, write bool) bool

func (*OpenIDConnectHook) OnConnectAuthenticate

func (h *OpenIDConnectHook) OnConnectAuthenticate(cl *mqtt.Client, pk packets.Packet) bool

func (*OpenIDConnectHook) Provides

func (h *OpenIDConnectHook) Provides(b byte) bool

func (*OpenIDConnectHook) SetupJWKS

func (h *OpenIDConnectHook) SetupJWKS() error

Called Automatically when calling NewOAuthHook

Jump to

Keyboard shortcuts

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