forked from influxdata/telegraf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
88133d0
commit c8d9a9b
Showing
2 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package microsoft_fabric | ||
|
||
import ( | ||
"context" | ||
|
||
eventhub "github.com/Azure/azure-event-hubs-go/v3" | ||
) | ||
|
||
type eventHub struct { | ||
hub *eventhub.Hub | ||
} | ||
|
||
func (e *eventHub) GetHub(connectionString string) error { | ||
hub, err := eventhub.NewHubFromConnectionString(connectionString) | ||
if err != nil { | ||
return err | ||
} | ||
e.hub = hub | ||
return nil | ||
} | ||
|
||
func (e *eventHub) Close(ctx context.Context) error { | ||
return e.hub.Close(ctx) | ||
} | ||
|
||
func (e *eventHub) SendBatch(ctx context.Context, iterator eventhub.BatchIterator, opts ...eventhub.BatchOption) error { | ||
return e.hub.SendBatch(ctx, iterator, opts...) | ||
} |