Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KafkaClient ¶
type KafkaClient struct {
// contains filtered or unexported fields
}
func NewKafkaClient ¶
func NewKafkaClient(brokers []string, maxRetries int, retryInterval time.Duration, config *sarama.Config, logger Logger) (*KafkaClient, error)
NewKafkaClient creates a new KafkaClient instance.
func (*KafkaClient) Close ¶
func (kc *KafkaClient) Close() error
Close closes the connection to Kafka.
func (*KafkaClient) IsReady ¶
func (kc *KafkaClient) IsReady() bool
IsReady returns the readiness state of the Kafka client.
func (*KafkaClient) SendBatch ¶
func (kc *KafkaClient) SendBatch(batch []*sarama.ProducerMessage) error
SendBatch sends a batch of messages to Kafka with retries.
func (*KafkaClient) StartBatchSender ¶
func (kc *KafkaClient) StartBatchSender(ringBuffer *kafkabuff.RingBuffer, batchSize int, interval time.Duration)
StartBatchSender starts sending messages from the ring buffer to Kafka.
type Logger ¶ added in v0.2.0
type Logger interface {
Debugf(format string, args ...interface{})
Infof(format string, args ...interface{})
Warnf(format string, args ...interface{})
Errorf(format string, args ...interface{})
}
Logger interface
Click to show internal directories.
Click to hide internal directories.