Documentation ¶
Index ¶
- func RestoreTopics(ctx context.Context, server string, topicsBackup TopicsBackup) error
- type MqttClient
- func (mqttClient *MqttClient) Close()
- func (mqttClient *MqttClient) Connect(ctx context.Context) error
- func (mqttClient *MqttClient) Disconnect(ctx context.Context) error
- func (mqttClient *MqttClient) Done() <-chan struct{}
- func (mqttClient *MqttClient) IncomingMessages() <-chan *paho.Publish
- func (mqttClient *MqttClient) Publish(ctx context.Context, p *paho.Publish) error
- func (mqttClient *MqttClient) Subscribe(ctx context.Context, s *paho.Subscribe) error
- type MqttParams
- type TopicsBackup
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RestoreTopics ¶ added in v1.1.26
func RestoreTopics(ctx context.Context, server string, topicsBackup TopicsBackup) error
RestoreTopics publishes topics from topicsBackup as retaines
Types ¶
type MqttClient ¶
type MqttClient struct {
// contains filtered or unexported fields
}
func NewMqttClient ¶
func NewMqttClient(params MqttParams) *MqttClient
func (*MqttClient) Close ¶
func (mqttClient *MqttClient) Close()
func (*MqttClient) Disconnect ¶
func (mqttClient *MqttClient) Disconnect(ctx context.Context) error
func (*MqttClient) Done ¶
func (mqttClient *MqttClient) Done() <-chan struct{}
func (*MqttClient) IncomingMessages ¶
func (mqttClient *MqttClient) IncomingMessages() <-chan *paho.Publish
type MqttParams ¶
type TopicsBackup ¶ added in v1.1.25
TopicsBackup holds the mqtt topics values
func BackupTopics ¶ added in v1.1.25
BackupTopics connects to a mqtt server and writes the topics and their content into the writer
Click to show internal directories.
Click to hide internal directories.