Documentation ¶
Index ¶
- Variables
- func Client() (mqtt.Client, error)
- func Close() error
- func Health() error
- func Init() error
- func Publish(topic string, payload any, opts ...PublishOption) error
- func Subscribe(topic string, handler MessageHandler, opts ...SubscribeOption) error
- func Unsubscribe(topics ...string) error
- type MessageHandler
- type PublishOption
- type SubscribeOption
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultPublishOption = PublishOption{ QoS: 0, Retain: false, Timeout: 5 * time.Second, }
View Source
var DefaultSubscribeOption = SubscribeOption{ QoS: 0, Timeout: 5 * time.Second, }
Functions ¶
func Subscribe ¶
func Subscribe(topic string, handler MessageHandler, opts ...SubscribeOption) error
func Unsubscribe ¶ added in v0.0.54
Types ¶
type MessageHandler ¶ added in v0.0.54
type PublishOption ¶ added in v0.0.54
type SubscribeOption ¶ added in v0.0.54
Click to show internal directories.
Click to hide internal directories.