batcher

package
v0.0.0-...-c7e4a36 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2025 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KafkaBatch

type KafkaBatch struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewKafkaBatch

func NewKafkaBatch(ctx context.Context, producer *kafka.Writer, frequency time.Duration, bufferSize uint) (*KafkaBatch, error)

func (*KafkaBatch) RunBatch

func (b *KafkaBatch) RunBatch(ctx context.Context)

func (*KafkaBatch) RunQueueReader

func (b *KafkaBatch) RunQueueReader(ctx context.Context)

func (*KafkaBatch) Send

func (b *KafkaBatch) Send(event any) error

Send is a wrapper around kafka producer to send logs

func (*KafkaBatch) SetLogger

func (b *KafkaBatch) SetLogger(logger Logger)

type Logger

type Logger interface {
	Info(args ...interface{})
	Warn(args ...interface{})
}

type ZeroLogger

type ZeroLogger struct{}

func (ZeroLogger) Info

func (ZeroLogger) Info(args ...interface{})

func (ZeroLogger) Warn

func (ZeroLogger) Warn(args ...interface{})

Jump to

Keyboard shortcuts

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