Versions in this module Expand all Collapse all v0 v0.0.1 Oct 30, 2023 Changes in this version + func NewKafkaWriter(brokers []string, topic string, batchSize int) *kafka.Writer + type Emitter struct + func NewEmitter(ctx context.Context, outbox OutboxSource, handler HandlerFunc, opts ...Option) *Emitter + func (e *Emitter) Run() + func (e *Emitter) Stop() + type Handler interface + Process func(ctx context.Context, msgs ...OutboxMsg) ([]int64, error) + type HandlerFunc func(ctx context.Context, msgs ...OutboxMsg) ([]int64, error) + func KafkaHandler(writer *kafka.Writer) HandlerFunc + func (f HandlerFunc) Process(ctx context.Context, msgs ...OutboxMsg) ([]int64, error) + type Logger interface + Printf func(string, ...interface{}) + type LoggerFunc func(msg string, args ...any) + func (f LoggerFunc) Printf(msg string, args ...any) + type Option func(emitter *Emitter) + func WithBatchSize(size int) Option + func WithErrorLogger(logger Logger) Option + func WithInterval(interval time.Duration) Option + func WithLogger(logger Logger) Option + type OutboxMsg struct + Key string + Msg []byte + RecID int64 + type OutboxSource interface + DeleteOutboxMsg func(ctx context.Context, recIDs ...int64) error + GetOutboxMsg func(ctx context.Context, batchSize int) ([]OutboxMsg, error)