eventhubs

package
v1.10.0-rc.5 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2023 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AzureEventHubs

type AzureEventHubs struct {
	// contains filtered or unexported fields
}

AzureEventHubs allows sending/receiving Azure Event Hubs events. This is an abstract class used by both the pubsub and binding components.

func NewAzureEventHubs

func NewAzureEventHubs(logger logger.Logger, isBinding bool) *AzureEventHubs

NewAzureEventHubs returns a new Azure Event hubs instance.

func (*AzureEventHubs) Close

func (aeh *AzureEventHubs) Close() (err error)

func (*AzureEventHubs) EventHubName

func (aeh *AzureEventHubs) EventHubName() string

EventHubName returns the parsed eventHub property from the metadata. It's used by the binding only.

func (*AzureEventHubs) Init

func (aeh *AzureEventHubs) Init(metadata map[string]string) error

Init connects to Azure Event Hubs.

func (*AzureEventHubs) Publish

func (aeh *AzureEventHubs) Publish(ctx context.Context, topic string, messages []*azeventhubs.EventData, batchOpts *azeventhubs.EventDataBatchOptions) error

Publish a batch of messages.

func (*AzureEventHubs) Subscribe

func (aeh *AzureEventHubs) Subscribe(subscribeCtx context.Context, topic string, getAllProperties bool, handler SubscribeHandler) (err error)

Subscribe receives data from Azure Event Hubs in background.

type SubscribeHandler

type SubscribeHandler func(ctx context.Context, data []byte, metadata map[string]string) error

Type for the handler for messages coming in from the subscriptions.

Jump to

Keyboard shortcuts

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