kafkautils

package
v0.0.0-...-6a9ad1a Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoProtoTypeHeader = fmt.Errorf("no proto type found in message headers")

Functions

func CreateErrorLogger

func CreateErrorLogger(l *zap.SugaredLogger) kafka.Logger

func CreateLogger

func CreateLogger(l *zap.SugaredLogger) kafka.Logger

func ProtoTypeFromHeaders

func ProtoTypeFromHeaders(headers []kafka.Header) (string, error)

Types

type ConsumerHandler

type ConsumerHandler interface {
	// Run starts the consumer handler
	// It will block until the context is cancelled
	Run(ctx context.Context)

	RegisterHandler(protoType proto.Message, consumer func(context.Context, *kafka.Message, proto.Message))
}

func NewConsumerHandler

func NewConsumerHandler(logger *zap.SugaredLogger,
	reader *kafka.Reader) ConsumerHandler

Jump to

Keyboard shortcuts

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