simple

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler implements mqtt.Handler interface

func New

func New(logger *slog.Logger) *Handler

New creates new Event entity

func (*Handler) AuthConnect

func (h *Handler) AuthConnect(ctx context.Context) error

AuthConnect is called on device connection, prior forwarding to the MQTT broker

func (*Handler) AuthPublish

func (h *Handler) AuthPublish(ctx context.Context, topic *string, payload *[]byte) error

AuthPublish is called on device publish, prior forwarding to the MQTT broker

func (*Handler) AuthSubscribe

func (h *Handler) AuthSubscribe(ctx context.Context, topics *[]string) error

AuthSubscribe is called on device publish, prior forwarding to the MQTT broker

func (*Handler) Connect

func (h *Handler) Connect(ctx context.Context) error

Connect - after client successfully connected

func (*Handler) Disconnect

func (h *Handler) Disconnect(ctx context.Context) error

Disconnect on connection lost

func (*Handler) Publish

func (h *Handler) Publish(ctx context.Context, topic *string, payload *[]byte) error

Publish - after client successfully published

func (*Handler) Subscribe

func (h *Handler) Subscribe(ctx context.Context, topics *[]string) error

Subscribe - after client successfully subscribed

func (*Handler) Unsubscribe

func (h *Handler) Unsubscribe(ctx context.Context, topics *[]string) error

Unsubscribe - after client unsubscribed

Jump to

Keyboard shortcuts

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