client

package
v2.1.0-beta.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Connect(ctx api.StreamContext) error
	Subscribe(ctx api.StreamContext, topic string, qos byte, callback MessageHandler) error
	Unsubscribe(ctx api.StreamContext, topic string) error
	Disconnect(ctx api.StreamContext)
	Publish(ctx api.StreamContext, topic string, qos byte, retained bool, payload []byte, properties map[string]string) error
	ParseMsg(ctx api.StreamContext, msg any) ([]byte, map[string]any, map[string]string)
}

Client is the interface for mqtt client. There are two implementations v4 and v5

type CommonConfig

type CommonConfig struct {
	Server   string `json:"server"`
	PVersion string `json:"protocolVersion"`
}

type ConnectErrorHandler

type ConnectErrorHandler func(ctx api.StreamContext, e error)

type ConnectHandler

type ConnectHandler func(ctx api.StreamContext)

type MessageHandler

type MessageHandler func(ctx api.StreamContext, msg any)

type SubscriptionInfo

type SubscriptionInfo struct {
	Qos     byte
	Handler MessageHandler
}

Jump to

Keyboard shortcuts

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