Documentation
¶
Overview ¶
Package iothub provides a client for Azure IoT Hub.
Connect to an IoT Hub using Dial passing in a ConnectionParameters struct. ConnectionParameters can be created manually, parsed from a connection string using ParseConnectionString, or created dynamically using the Device Provisioning Service using the github.com/vanti-dev/sc-bos/pkg/internal/iothub/dps package.
Index ¶
Constants ¶
View Source
const APIVersion = "2021-04-12"
Variables ¶
View Source
var ErrInvalidConnectionString = errors.New("invalid connection string")
Functions ¶
func MQTTClientOptions ¶
Types ¶
type Conn ¶
type Conn interface {
// SendOutputMessage sends telemetry as json encode payload to the device event topic.
SendOutputMessage(ctx context.Context, telemetry any) error
io.Closer
}
Conn represents a connection to IoT Hub.
type ConnectionParameters ¶
type ConnectionParameters struct {
HostName string
DeviceID string
ModuleID string
GatewayHostName string
X509 string
}
func ParseConnectionString ¶
func ParseConnectionString(cs string) (ConnectionParameters, error)
Click to show internal directories.
Click to hide internal directories.