Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewKafkaWriter ¶
NewKafkaWriter creates a new kafka writer.
Types ¶
type Emitter ¶
type Emitter struct {
// contains filtered or unexported fields
}
func NewEmitter ¶
func NewEmitter(ctx context.Context, outbox OutboxSource, handler HandlerFunc, opts ...Option) *Emitter
type HandlerFunc ¶
HandlerFunc is an adapter to allow the use of ordinary functions as a OutboxMsg handler. If f is a function with the appropriate signature, HandlerFunc(f) is a Handler that calls f.
func KafkaHandler ¶
func KafkaHandler(writer *kafka.Writer) HandlerFunc
KafkaHandler writes messages to kafka with a kafka writer.
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 Option ¶
type Option func(emitter *Emitter)
Option is a function that configures an Emitter.
func WithBatchSize ¶
WithBatchSize sets the batch size for the emitter.
func WithErrorLogger ¶
WithErrorLogger sets the error logger for the antenna.
func WithInterval ¶
WithInterval sets the interval for the emitter.
Click to show internal directories.
Click to hide internal directories.