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 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 }
Click to show internal directories.
Click to hide internal directories.