mosquitto改mqtt
This commit is contained in:
parent
1ba9b3ab0a
commit
ccdcfc4ebc
|
|
@ -1,7 +1,8 @@
|
|||
package mosquitto
|
||||
package mqtt
|
||||
|
||||
type Config struct {
|
||||
Host string
|
||||
Username string
|
||||
Password string
|
||||
ClientID string
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package mosquitto
|
||||
package mqtt
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package mosquitto
|
||||
package mqtt
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
|
@ -26,6 +26,7 @@ func Options() *MQTT.ClientOptions {
|
|||
opts.AddBroker(config.Host)
|
||||
opts.Username = config.Username
|
||||
opts.Password = config.Password
|
||||
opts.ClientID = config.ClientID
|
||||
return opts
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue