From bc2987d6d5deed48b84abd63d3bb4ab4e315c3d5 Mon Sep 17 00:00:00 2001 From: fischor Date: Tue, 18 Feb 2020 19:56:42 +0100 Subject: [PATCH] Add IoT Hub System Properties (#161) * Add IoT Hub System Properties * update CHANGELOG and version Co-authored-by: Joel Hendrix --- changelog.md | 3 +++ event.go | 12 +++++++++++- version.go | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index 8e14f9d4..8ddd683c 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,8 @@ # Change Log +## `v3.2.0` +- add IoT Hub system properties + ## `v3.1.2` - fix errors in message handling being ignored [#155](https://github.com/Azure/azure-event-hubs-go/issues/155) diff --git a/event.go b/event.go index 298a0200..dc1bb005 100644 --- a/event.go +++ b/event.go @@ -28,8 +28,8 @@ import ( "strings" "time" - "github.com/mitchellh/mapstructure" "github.com/Azure/go-amqp" + "github.com/mitchellh/mapstructure" "github.com/Azure/azure-event-hubs-go/v3/persist" ) @@ -59,6 +59,16 @@ type ( Offset *int64 `mapstructure:"x-opt-offset"` PartitionID *int16 `mapstructure:"x-opt-partition-id"` // This value will always be nil. For information related to the event's partition refer to the PartitionKey field in this type PartitionKey *string `mapstructure:"x-opt-partition-key"` + // Nil for messages other than from Azure IoT Hub. deviceId of the device that sent the message. + IoTHubDeviceConnectionID *string `mapstructure:"iothub-connection-device-id"` + // Nil for messages other than from Azure IoT Hub. Used to distinguish devices with the same deviceId, when they have been deleted and re-created. + IoTHubAuthGenerationID *string `mapstructure:"iothub-connection-auth-generation-id"` + // Nil for messages other than from Azure IoT Hub. Contains information about the authentication method used to authenticate the device sending the message. + IoTHubConnectionAuthMethod *string `mapstructure:"iothub-connection-auth-method"` + // Nil for messages other than from Azure IoT Hub. moduleId of the device that sent the message. + IoTHubConnectionModuleID *string `mapstructure:"iothub-connection-module-id"` + // Nil for messages other than from Azure IoT Hub. The time the Device-to-Cloud message was received by IoT Hub. + IoTHubEnqueuedTime *time.Time `mapstructure:"iothub-enqueuedtime"` } mapStructureTag struct { diff --git a/version.go b/version.go index 536932ab..0b80e9c2 100644 --- a/version.go +++ b/version.go @@ -2,5 +2,5 @@ package eventhub const ( // Version is the semantic version number - Version = "3.1.2" + Version = "3.2.0" )