go-eventhub

module
v0.0.0-...-2ad9471 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2017 License: Apache-2.0

README

Azure EventHub Golang REST client

Azure EventHub client library uses an Azure EventHub (ServiceBus) REST endpoints. The motivation behind this code is absense of simple, not-AMQP, but REST-based client for Azure EventHub

Available operations:

  • CreateEventHub
  • Send
  • SendBatch (be careful - there is 256Kb limitation should be handled by you)
  • PeekLockMessage - peek and lock message for processing
  • SetSubscription - target subscription for peeklock
  • DeleteMessage

Installation

$ go get -u github.com/Azure/go-autorest/autorest
  • Go get the lib:
$ go get -u github.com/KirillSleta/go-eventhub

Code sample

func sendData(client EventHubClient, hub string, data interface{}) error {
	payload, err := convertDataToJsonPayload(data)
	if err != nil {
		return err
	}
	client.Send(hub, &eventhub.Message{Body: payload})

	return nil
}

License

This project is published under Apache 2.0 License.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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