Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Antenna ¶
type Antenna struct {
// contains filtered or unexported fields
}
Antenna is a helper for consuming Kafka messages
func NewAntenna ¶
NewAntenna creates a new Antenna instance
type HandlerFunc ¶
The HandlerFunc type is an adapter to allow the use of ordinary functions as a Kafka handler. If f is a function with the appropriate signature, HandlerFunc(f) is a Handler that calls f.
type Logger ¶
type Logger interface {
Printf(string, ...interface{})
}
Logger interface API for log.Logger.
type LoggerFunc ¶
LoggerFunc is a bridge between Logger and any third party logger Usage:
l := NewLogger() // some logger a := antenna.NewAntenna(...) a.SetLogger(LoggerFunc(l.Infof)) a.SetErrorLogger(LoggerFunc(l.Errorf))
func (LoggerFunc) Printf ¶
func (f LoggerFunc) Printf(msg string, args ...any)
Printf implements Logger interface.
type OffsetProvider ¶
type OffsetProvider interface {
GetOffset(ctx context.Context, topic string, partition int) (int64, error)
}
OffsetProvider provides offset for a topic partition
type Option ¶
type Option func(*Antenna)
Option is a function that configures an Antenna.
func WithErrorLogger ¶
WithErrorLogger sets the error logger for the antenna.
func WithMessageHandler ¶
WithMessageHandler sets the message handler for the antenna.
func WithOffsetProvider ¶
func WithOffsetProvider(offsetProvider OffsetProvider) Option
WithOffsetProvider sets the offset provider for the antenna.