mqtt

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CheckCmd = &cobra.Command{
	Use:   "check-mqtt",
	Short: "Checks if an MQTT connection can be established",
	Long:  `Checks if an MQTT connectoin can be established with the provided certs`,
	Args:  cobra.NoArgs,
	Run: func(cmd *cobra.Command, args []string) {
		if err := checkParameters(); err != nil {
			log.Fatal(err)
		}

		keypair := models.KeyPair{
			PrivateKeyPath:    privateKeyPath,
			CertificatePath:   certificatePath,
			CACertificatePath: rootCAPath,
		}

		if _, err := MakeMQTTClient(keypair, endpoint, clientID); err != nil {
			log.Fatal(err)
		}

		log.Printf("MQTT connection established")
	},
}

CheckCmd checks if an MQTT connnection can be established

Functions

func MakeMQTTClient

func MakeMQTTClient(keyPair models.KeyPair, awsEndpoint, clientID string) (mqtt.Client, error)

MakeMQTTClient creates a new AWS IoT MQTT client.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL