mqtt.go 373 B

12345678910111213141516171819
  1. package cmd
  2. import (
  3. "kpt-temporary-mqtt/config"
  4. "kpt-temporary-mqtt/mqtt"
  5. "github.com/spf13/cobra"
  6. )
  7. // mqttCmd represents the mqtt command
  8. var mqttCmd = &cobra.Command{
  9. Use: "mqtt",
  10. Short: "mqtt",
  11. Run: func(cmd *cobra.Command, args []string) {
  12. configOption := config.Options()
  13. client := mqtt.NewMqtt(configOption)
  14. mqtt.SubMsg(configOption, client)
  15. },
  16. }