azure

package
v1.2.13 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseEvent

func ParseEvent(event azhub.Event, e *entry.Entry) error

ParseEvent parses an Azure Event Hub event as an Entry.

Types

type AzureConfig

type AzureConfig struct {
	helper.InputOperator

	// required
	Namespace        string `json:"namespace,omitempty"         yaml:"namespace,omitempty"`
	Name             string `json:"name,omitempty"              yaml:"name,omitempty"`
	Group            string `json:"group,omitempty"             yaml:"group,omitempty"`
	ConnectionString string `json:"connection_string,omitempty" yaml:"connection_string,omitempty"`

	// optional
	PrefetchCount uint32 `json:"prefetch_count,omitempty" yaml:"prefetch_count,omitempty"`
	StartAt       string `json:"start_at,omitempty"       yaml:"start_at,omitempty"`
	// contains filtered or unexported fields
}

AzureConfig is the configuration of a Azure Event Hub input operator.

func (*AzureConfig) Build

func (a *AzureConfig) Build(buildContext operator.BuildContext, input helper.InputConfig) error

type EventHub

type EventHub struct {
	AzureConfig
	Persist *Persister
	WG      sync.WaitGroup
	Handler func(context.Context, *azhub.Event) error
	// contains filtered or unexported fields
}

Eventhub provides methods for reading events from Azure Event Hub.

func (*EventHub) Connect

func (e *EventHub) Connect() error

Connect initializes the connection to Azure Event Hub ensures the input parameters are valid

func (*EventHub) StartConsumers

func (e *EventHub) StartConsumers(ctx context.Context) error

StartConsumers starts an Azure Event Hub handler for each partition_id.

func (*EventHub) StopConsumers

func (e *EventHub) StopConsumers() error

StopConsumers closes connections to Azure Event Hub.

type Persister

type Persister struct {
	DB helper.Persister
}

Persister implements persist.CheckpointPersister

func (*Persister) Read

func (p *Persister) Read(namespace, name, consumerGroup, partitionID string) (persist.Checkpoint, error)

Read retrieves an Azure Event Hub Checkpoint from the Stanza persistence backend

func (*Persister) Write

func (p *Persister) Write(namespace, name, consumerGroup, partitionID string, checkpoint persist.Checkpoint) error

Write records an Azure Event Hub Checkpoint to the Stanza persistence backend

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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