eventbuskafka

package
v0.0.0-...-5fa8032 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultConfig

func DefaultConfig() *sarama.Config

Types

type Publisher

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

func NewPublisher

func NewPublisher(
	addr []string,
	conf *sarama.Config,
	opts ...PublisherOption,
) *Publisher

func (*Publisher) Close

func (p *Publisher) Close() error

func (*Publisher) Connect

func (p *Publisher) Connect() (err error)

func (*Publisher) Publish

func (p *Publisher) Publish(events []*event.Event) error

type PublisherOption

type PublisherOption func(*Publisher)

func WithPublisherCodec

func WithPublisherCodec(codec event.Encoding) PublisherOption

type Subscriber

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

func NewSubscriber

func NewSubscriber(
	addr []string,
	conf *sarama.Config,
	opts ...SubscriberOption,
) *Subscriber

func (*Subscriber) Cleanup

func (s *Subscriber) Cleanup(sess sarama.ConsumerGroupSession) error

func (*Subscriber) Close

func (s *Subscriber) Close() error

func (*Subscriber) ConsumeClaim

func (s *Subscriber) ConsumeClaim(session sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error

func (*Subscriber) Listen

func (s *Subscriber) Listen(ctx context.Context) (err error)

func (*Subscriber) Setup

func (*Subscriber) Subscribe

func (s *Subscriber) Subscribe(streamName string, h ...stream.EventHandler)

type SubscriberOption

type SubscriberOption func(*Subscriber)

func WithSubscriberBeforeFunc

func WithSubscriberBeforeFunc(fn func(*sarama.ConsumerMessage) (bool, error)) SubscriberOption

func WithSubscriberCleanupFunc

func WithSubscriberCleanupFunc(fn func(sarama.ConsumerGroupSession) error) SubscriberOption

func WithSubscriberCodec

func WithSubscriberCodec(codec event.Encoding) SubscriberOption

func WithSubscriberContextFunc

func WithSubscriberContextFunc(fn func(context.Context) context.Context) SubscriberOption

func WithSubscriberDeduplicator

func WithSubscriberDeduplicator(d eventbus.Deduplicator) SubscriberOption

func WithSubscriberErrorHandler

func WithSubscriberErrorHandler(fn func(*event.Event, error)) SubscriberOption

func WithSubscriberExitFunc

func WithSubscriberExitFunc(fn func()) SubscriberOption

func WithSubscriberGroupName

func WithSubscriberGroupName(groupName string) SubscriberOption

func WithSubscriberSetupFunc

func WithSubscriberSetupFunc(fn func(sarama.ConsumerGroupSession) error) SubscriberOption

Jump to

Keyboard shortcuts

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