Documentation ¶
Overview ¶
Package eventhub provides methods to interact, publish and consume events from Azure Eventhub
Index ¶
- func New(c *Config) (pubsub.PublisherSubscriber, error)
- func NewEventHubWithAvro(config *AvroWithEventhubConfig, logger log.Logger) (pubsub.PublisherSubscriber, error)
- type AvroWithEventhubConfig
- type Config
- type Eventhub
- func (e *Eventhub) Bind(message []byte, target interface{}) error
- func (e *Eventhub) CommitOffset(pubsub.TopicPartition)
- func (e *Eventhub) HealthCheck() types.Health
- func (e *Eventhub) IsSet() bool
- func (e *Eventhub) Ping() error
- func (e *Eventhub) PublishEvent(key string, value interface{}, headers map[string]string) (err error)
- func (e *Eventhub) PublishEventWithOptions(key string, value interface{}, _ map[string]string, _ *pubsub.PublishOptions) (err error)
- func (e *Eventhub) Subscribe() (*pubsub.Message, error)
- func (e *Eventhub) SubscribeWithCommit(pubsub.CommitFunc) (*pubsub.Message, error)
- type Offset
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewEventHubWithAvro ¶
func NewEventHubWithAvro(config *AvroWithEventhubConfig, logger log.Logger) (pubsub.PublisherSubscriber, error)
NewEventHubWithAvro initialize EventHub with Avro when EventHubConfig and AvroConfig are right
Types ¶
type AvroWithEventhubConfig ¶
AvroWithEventhubConfig combines the Azure Eventhub configuration and Avro configuration.
type Config ¶
type Config struct { Namespace string EventhubName string ClientID string ClientSecret string TenantID string // Offsets is slice of Offset in which "PartitionID" and "StartOffset" // are the field needed to be set to start consuming from specific offset Offsets []Offset ConnRetryDuration int }
Config contains configuration options for interacting with Azure Eventhub.
type Eventhub ¶
type Eventhub struct { Config // contains filtered or unexported fields }
Eventhub represents a client to interact with Azure Eventhub.
func (*Eventhub) Bind ¶
Bind parses the encoded data and stores the result in the value pointed to by target
func (*Eventhub) CommitOffset ¶
func (e *Eventhub) CommitOffset(pubsub.TopicPartition)
CommitOffset not implemented for Eventhub
func (*Eventhub) HealthCheck ¶
HealthCheck returns the health of the PubSub
func (*Eventhub) PublishEvent ¶
func (e *Eventhub) PublishEvent(key string, value interface{}, headers map[string]string) (err error)
PublishEvent publishes the event to eventhub
func (*Eventhub) PublishEventWithOptions ¶
func (e *Eventhub) PublishEventWithOptions(key string, value interface{}, _ map[string]string, _ *pubsub.PublishOptions) (err error)
PublishEventWithOptions publishes message to eventhub. Ability to provide additional options described in PublishOptions struct
func (*Eventhub) SubscribeWithCommit ¶
SubscribeWithCommit calls the CommitFunc after subscribing message from eventhub and based on the return values decides whether to commit message and consume another message